Reputation: 93
I want Nginx to update configuration file without reloading or restarting Nginx. It seem API or anything (http://nginx.com/products/on-the-fly-reconfiguration/).
Upvotes: 9
Views: 13273
Reputation: 16666
On Ubuntu or Debian it's as simple as using the reload
argument:
service nginx reload
The official way is to send SIGHUP:
kill -HUP $(ps -ef | grep nginx | grep master | awk '{print $2}')
The above command will get the process ID of the nginx master process and send a SIGHUP signal to it.
See the Controlling Nginx documentation for Nginx.
You can also use the Nginx binary:
nginx -s reload
Upvotes: 16