Nginx startup scripts

Igor Sysoev igor at sysoev.ru
Thu Jun 24 18:25:15 MSD 2010


On Thu, Jun 24, 2010 at 03:15:26PM +0100, Mark Rogers wrote:

> I'm considering nginx as an upgrade from Apache, on a virtual server 
> with many virtual hosts. I have no nginx experience (yet!)
> 
> I know that there are many reasons why nginx is likely better than 
> Apache in my environment, but on the other hand "if it isn't broken, 
> don't fix it". However, there is one aspect that I consider broken, so 
> if nginx handles things differently that could be the reason to switch.
> 
> With Apache, if the config file has an error in it, Apache will error 
> and stop. The config test doesn't catch all possible errors (eg I had a 
> situation where an SSL certificate was updated without the SSL key, and 
> the config test showed no problems, but a config reload took the server 
> offline for several minutes while the problem was resolved).
> 
> How robust is nginx?
> 
> To me, it seems simple: there should be startup scripts that start the 
> server, and roll-back to a known-good config if the current config 
> fails. But whatever the method, I'm looking for a server which has 
> considered this and found a solution to it.
> 
> Note: I am looking to use a distro package (to make maintenance easy) so 
> I'm not really looking for custom scripts, although that's not being 
> ruled out. Distro will likely be Ubuntu server.

You can run "nginx -t" before applying configuration: it catches almost all
possible errors except some fatal errors: no memory, files, etc.
If you send -HUP signal to reconfigure and a new configuration is bad,
then nginx continues to run with an old configuration, if no fatal
errors will happen. SSL certificate without key case is not the fatal error.


-- 
Igor Sysoev
http://sysoev.ru/en/



More information about the nginx mailing list