Apache有一个graceful选项,可以在不重启Apache的情况下扫描http.conf修改。 那么nginx呢?
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)
来源: http : //nginx.org/en/docs/control.html
使用nginx -s重新加载
通常nginx的init脚本有reload操作,即:
/etc/init.d/nginx reload /usr/local/etc/rc.d/nginx reload service nginx reload ?
PS在Windows上不起作用。
我刚才写了关于如何在零宕机的情况下重新启动nginx的问题。 这可能对你有帮助。
http://tumblelog.jauderho.com/post/101514948/restart-nginx-with-zero-downtime