Gradual Epiphany

Switching to nginx...not

Over the Thanksgiving holidays, I’ve been looking into switching over the RimuHosting VPS to the nginx webserver. nginx is a fast little webserver that has a smaller memory footprint than lighttpd — this is an important attribute when you are running on only 96M of RAM.

Unfortunately, getting nginx going can be challenging. The available English docs are pretty sparse, as nginx was developed in Russia. Even with the sparse docs, I was able to get a basic configuration working on my VPS. However, once I wanted to start integrating with PHP, particularly with FastCGI, the configuration got out of hand. Basically, nginx doesn’t provide virtual-to-physical mapping of FastCGI paths, so for each virtual location that you want to use FastCGI (or PHP, in this case), you have to provide an explicit mapping to the location of the PHP script. Now, I’m sure there are security people out there who might say that’s desirable, as it requires specific enabling of the functionality for each virtual location. However, from a management standpoint, I hate having to duplicate configuration. A decent webserver should (IMNSHO) ensure that you don’t repeat yourself when it comes to configuration, particularly if it’s possible for the webserver to sort it out.

So, that’s my experience with nginx. I will say that I successfully deployed it at work for an internal dev server where we needed a reverse-proxy into some Java apps. It worked great for that. It’s just not yet ready for those of us who need to use PHP/FastCGI integration.