How to update nginx configuration without rebooting or restarting nginx

I want Nginx to update the configuration file without rebooting or restarting Nginx. Is this an API or something else ( http://nginx.com/products/on-the-fly-reconfiguration/ ).

+4
source share
1 answer

On Ubuntu or Debian, this is as simple as using an argument reload:

service nginx reload

The official way is to transmit SIGHUP:

kill -HUP $(ps -ef | grep nginx | grep master | awk '{print $2}')

The above command will receive the process id of the main nginx process and send a SIGHUP signal to it.

See the Nginx Controlling documentation for Nginx.

You can also use the Nginx binary:

nginx -s reload
+9
source

Source: https://habr.com/ru/post/1530750/


All Articles