From the nginx wiki pages
The master process can handle the following signals: TERM, INT Quick shutdown
QUIT Graceful shutdown KILL Halts a stubborn process HUP Configuration reload. Start the new worker processes with a new configuration. Gracefully shutdown the old worker processes USR1 Reopen the log files USR2 Upgrade Executable on the fly WINCH Gracefully shutdown the worker processes
The syntax is as follows to
kill -HUP $( cat /path/to/nginx.pid )
OR find nginx pid with the pgrep command or ps command:
pgrep nginx ps aux | grep [n]ginx
Sample outputs:
root 4333 0.0 0.4 70776 9352 ? Ss Nov24 0:00 nginx: master process /usr/local/nginx/sbin/nginx nginx 9921 1.0 0.5 70776 9888 ? S Dec05 19:24 nginx: worker process nginx 9922 1.0 0.5 70776 10240 ? S Dec05 19:42 nginx: worker process nginx 9923 0.0 0.4 70776 8724 ? S Dec05 0:00 nginx: cache manager process
Type the following command as root user:
kill -HUP 4333
If you are using Nginx version 0.7.53+
Pass the -s reload option:
# nginx -s reload
OR
# /usr/local/nginx/sbin -s reload
If you are using Debian / CentOS / RHEL / Fedora / Ubuntu Linux try
# /etc/init.d/nginx reload
If you are using FreeBSD try
# /usr/local/etc/rc.d/nginx reload
If you are using OpenBSD try
# /usr/sbin/nginx -s reload
OR
# /etc/rc.d/nginx reload
How do I reload / gracefully restart chrooted nginx server?
Type the following command:
/usr/sbin/chroot /jail /usr/local/nginx/sbin/nginx -s reload
You should follow me on twitter here or grab rss feed to keep track of new changes.
Featured Articles:
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012

- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop














{ 0 comments… add one now }