Over the weekend I moved some of my rails applications to yet another rails deployment option (See my previous posts on deploying rails with apache, mongrel and mod_proxy_balancer or pound, lighttptd and mongrel).
I replaced apache with nginx, a small fast webserver with good proxying and rewriting capabilities. Nginx is extremely fast, a lot easier to configure than apache and uses much less memory. The process was remarkably painless. The steps I took were:
I’d intended to migrate to nginx for a while now because I’d heard a lot of good things about it. But I held off migrating sites because of lack of documention and the fact that other deployment options were working well for me.
Of all the deployment options I’ve used so far, this was by far the quickest and easiest to get setup. The nginx_config_generator gem automated most of the configuration and made it very easy to configure multiple vhosts. You create a YAML file describing your vhosts and then generate your nginx config file from this. Here is an example YAML description.
You can also run php apps under Nginx using fastcgi.
Post new comment