Apache has a graceful option which can scan for modification in http.conf without restarting apache,what about nginx?

link|improve this question

12% accept rate
feedback

4 Answers

up vote 13 down vote accepted

nginx supports the following signals :

TERM, INT - Quick shutdown
QUIT - Graceful shutdown
HUP - Configuration reload: Start the new worker processes with a new configuration, Gracefully shutdown the old worker processes
USR1 - Reopen the log files
USR2 - Upgrade Executable on the fly
WINCH - Gracefully shutdown the worker processes

HUP is what you are looking for : so : $ sudo kill -HUP pid (nginx pid)

source : https://boxpanel.blueboxgrp.com/public/the_vault/index.php/Restarting_Nginx_After_Configuration_Changes

link|improve this answer
feedback

Usually nginx's init-script has reload action, i.e:

  • Linux /etc/init.d/nginx reload
  • FreeBSD /usr/local/etc/rc.d/nginx reload
link|improve this answer
feedback

Use nginx -s reload

link|improve this answer
feedback

I wrote about how to restart nginx with zero downtime a while ago. This may be helpful for you.

http://tumblelog.jauderho.com/post/101514948/restart-nginx-with-zero-downtime

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.