NGINX dynamic reverse proxying using Lua

I was looking for interesting stuff and found a project called hipache from dotcloud written in node.js.

I start wondering if was possible to rebuild it using nginx + Lua but as it turns out, it was already made by Sam Alba from dotcloud as hipache-nginx.

Read More

NGINX passive cache invalidation

Let’s talk again about nginx caching, another post that I wrote about cache purging can be a good start for you.

First of all, this is a proof-of-concept and was not used in production (yet), so if you are brave enough to use it, let me know the results.

Read More

Override templates from third-party cookbooks on chef

Some people prefer to develop everything from scratch, and I prefer to reuse everything if it’s possible, the only rule that I need to follow is that I need to find out a way to do it without changing a third party application.

Some months ago, because of some security requirements, I needed to change the default configuration of the rsyslog cookbook.

Read More

Keepalive proxy using NGINX

Lets cleanup the dust here!

PHP applications can’t handle persistent connections, at least not without a lot of effort and esoteric solutions.

If you need to call external HTTP servers, for example, web services, this can cause a huge performance impact as your application will reestablish the connection on every request and if it uses SSL will be even worse.

Read More

Replacing spaces in URL in apache using mod_rewrite

Let me tell you a small tale about a developer and an outsourced sysadmin.

The developers hired the sysadmin to fix his application issues on the infrastructure, and at those time the problem was spaces on the URL’s, and to fix this, the sysadmin learned that recursive RewriteRules are evil and can crash his loved servers.

Read More

Shared persistence between virtual servers in keepalived

If you are afraid of reading this long post TL;DR to have shared persistence you will need to use iptables fwmark or service port 0 on keepalived, but if you are brave enough to read it, let’s start from the basics.

First, we need to understand the difference between persistence algorithm and scheduling algorithm.

Read More

Troubleshoot slow request on IIS and Apache

From time to time, I see operations-peeps struggling with web applications, trying to find out what’s causing problems on his infrastructure.

It’s even more difficult when you try to debug it, working together with the developer, usually the default excuse for both sides is: “It was working, nothing was changed.”, but the problem still exists and needs to be solved, no matter who changed it or not.

Read More