Answers:
nginx支持以下信号:
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是您想要的,所以 sudo kill -HUP pid (nginx pid)
使用Nginx -s重新加载
通常,nginx的init-script具有reload
作用,即:
/etc/init.d/nginx reload
/usr/local/etc/rc.d/nginx reload
不久前,我写了一篇关于如何以零停机时间重启nginx的文章。这可能对您有帮助。
http://tumblelog.jauderho.com/post/101514948/restart-nginx-with-zero-downtime
USR2
用于升级可执行文件,而不是用于简单的配置重新加载。