Passenger recently got support for Nginx, what are the pros and cons of it over Apache as a web server for Rails applications?
locked by sysadmin1138♦ Jan 2 '12 at 2:54
This question exists because it has historical significance, but it is not considered a good, on-topic question for this site, so please do not use it as evidence that you can ask similar questions here. This question and its answers are frozen and cannot be changed. More info: help center.
Read more about locked posts here.
Nginx is far more lightweight, taking up less memory and other resources. On the other hand, Apache has more esoteric modules, built-in support for many more things, and is more widely used, both in general (so more docs and blog posts on using it for different tasks) and with Passenger (and so more of the kinks will have been found and fixed already).
On a more subjective level, I find nginx's config file format to be easier to work with and it's request processing model more intuitive.
Here's a con to NGINX:
While I'm getting used to NGINX, I would say I'm surprised at how often I need to restart the NGINX server when configuring rewrite rules and creating new directories for applications, etc...
That said, I just set up Passenger, Ruby Enterprise Edition, and Nginx on a VPS with 360 MB of ram. I have limited experience with Apache in a shared hosting environment a couple of years ago. Apache's .htaccess files, if I recall correctly, seemed to be more dynamic. The lack of dynamic configuration seems to be not a problem since the VPS is mine.