Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have two questions:

  • Is there a difference between: nginx -s reload and pkill -HUP -F
  • What is the proper way to watch the Nginx conf file and upon changes test the conf file (nginx -t), and if it passes reload Nginx. Can that be done with runit or a process manager like Supervisor?
share|improve this question
What specific GNU/Linux distro is this? – dawud May 29 '13 at 19:27
up vote 0 down vote accepted

nginx -s reload also sends a HUP signal as per the man pages.

Refer to Nginx Man Pages

For the second part. It is possible monitor the nginx.conf file for changes and trigger a test and reload on change. I use a bash script and run it every 15 seconds using supervise. Monitor the mtime of the config file and upon change run nginx -t which will return exit code 0 upon successful verification of config file, then reload.

share|improve this answer
If it is GNU/Linux, you can use inotify or on FreeBSd you can use kqueue/kevent to monitor a file (windows has IO completion ports). The mtime approach can be faked via setattr to reset the mtime but should suffice for simple needs and it is based on polling. – hackworks Jun 3 '13 at 3:14
is this better than using /etc/init.d/nginx reload ? – DanFromGermany Jan 19 '14 at 19:20

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.