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
source
share