When to restart and not reload Nginx? When to restart and not reload Nginx? nginx nginx

When to restart and not reload Nginx?


Reloading nginx is safer than restarting because before old process will be terminated, new configuration file is parsed and whole process is aborted if there are any problems with it.

On the other hand when you restart nginx you might encounter situation in which nginx will stop, and won't start back again, because of syntax error.

Reloading terminates the old process, so any memory leaks should be cleared anyway.


I've experienced a case where I needed to restart nginx to have listen directives for a new IP adress kick in.


Ztyx is right - restarting when changing a listen directive is required in some cases.

With 1.6.x, you can reload when changing the listen IP address, but you need to restart when listening from "*:80" to an IP address "x.x.x.x:80".

I have only confirmed this with IPv4, behavior for IPv6 may be similar.