It’s important to keep your Nginx server up when you try to upgrade your Nginx to a newer version. I tried following steps successfully.
- Check the compile configuration for previous version:
Configure the new version according to the previous configuration and your need.
Compile and install
make & make install
- Send USR2(12) signal to the master process:
kill -USR2 `cat /usr/local/nginx/logs/nginx.pid`
A new file name nginx.pid.oldbin appeared in /usr/local/nginx/logs/.
- Send WINCH(28) signal to master process in order to shutdown the worker process gracefully:
kill -WINCH `cat /usr/local/nginx/logs/nginx.pid.oldbin`
- Send QUIT signal to shutdown the master process:
kill -QUIT `cat /usr/local/nginx/logs/nginx.pid.oldbin`
Now the nginx server should have been upgraded gracefully.