聘我网

新概念招聘3.0

Nginx不重启让配置修改生效?

vote up0vote downstar

有解吗? 像Apachegraceful一样?

/usr/sbin/apachectl -f httpd.conf -k graceful
 

1 个答复

vote up0vote downcheck

解决为:

sudo kill -HUP pid (nginx pid)

The proper way to restart Nginx after a configuration change is to use the built in signals. As noted on the Nginx Wiki, the following signals are presently supported:

* 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

https://boxpanel.blueboxgrp.com/public/thevault/index.php/RestartingNginxAfterConfiguration_Changes

更新

较新版本的nginx还可以这样:

path_to_nginx/nginx reload

或者

path_to_nginx/nginx -s reload
链接

您的回答





不是您要找的问题? 浏览其他含有标签 的问题或者 自己问个.