Tuesday, June 18, 2013

How to restart nginx after updating configuration

The best way to restart nginx server after updating the configuration (/etc/nginx/sites-enabled/default or /etc/nginx/nginx.conf) is to not restart it at all. Instead, send it a kill command with the hangup (HUP) argument

# kill -HUP `cat /var/run/nginx.pid`

/HUP
...
     name. There is no default. Typing kill  does not send a sig-
     nal  to  the  current  job. If the signal being sent is TERM
     (terminate) or HUP (hangup), then the job or process is sent
     a CONT (continue) signal as well.

No comments:

Post a Comment