Okay, so I just went ahead and tried it; I’m very pleased so far, as the memory use seems to be considerably more stable than apache was, with no apparent loss of performance, though PHP is my bottleneck so I didn’t expect that to change.
To answer some of my own questions; it seems that simply having an admin account means that Dreamhost won’t automatically manage nginx, I’m still not completely sure what the specifics of this are, but it meant that I decided not to setup an admin user for this reason, though it has introduced a couple of minor inconveniences.
The first was to do with setting up redirections etc.; fortunately this is nice and easy to do as you just need a $HOME/nginx/ folder for each domain you want to create rules for, and just add as many .conf files there as you like to keep the rules organised. The only difficulties that I discovered is that without an admin account you can’t restart nginx directly, which means you need to request a reboot which is slower (and limited to once per 15 minutes I believe). The other issue is that I couldn’t find a way to get at any of nginx’s logs, which makes validating settings difficult. In the end what I did was created a stripped down nginx configuration file that imported all the .conf files I wanted to test, and then ran the following command as a regular user:
The above command tells nginx to just test the settings provided, which it will do. You might get some errors about not being root, but it should highlight any syntax errors or broken rules that would prevent nginx from starting up after rebooting. Since a full reboot is required it will be very important to run tests in this way before changing any of the .conf files, otherwise you’re stuck without a web-server for 15 minutes till you can fix it and reboot again. If someone knows of a quicker method then I’d love to hear it!
I found how to modify file MIME types, in my case I did it with a standard rule with the add_header directive setting a different mime-type to ensure files are downloaded by default. It’s pretty easy to setup most rules actually, and I do think it’s better consolidating them into one place, as I didn’t realise how many separate .htaccess files I had!
Contrary to the wiki page though, I’ve used the following basic command for redirections:
I’m not sure if I should change the wiki? It sounds like the above may be a lot more efficient than the recommended if conditions with a rewrite command, or does the nginx startup process optimise that to be the same thing?
Oh, and PHP RC settings seem to work just fine, only thing is that I think nginx doesn’t respect the choice of PHP version for a domain, so I may be stuck in PHP 5.3, I tried a command from the wiki to change PHP versions but it didn’t appear to do anything, does anyone know of the correct process for changing this, or is it an admin-only feature?