nginx modify configuration without restarting

How to Change NGINX Config Without Restarting

NGINX is a popular web server used by millions of websites and organizations to run their applications. Often system administrators need to change NGINX configuration of their server. But these changes do not apply immediately since NGINX continues to run on the previous version of configuration file. So administrators often restart NGINX server just to apply these changes. This can be tedious especially on production systems, since it means your website/app will be offline until NGINX restarts completely. Then how to change NGINX config without restarting? In this article, we will learn how to change NGINX config without restarting.


How to Change NGINX Config Without Restarting

The simplest way to change NGINX config without restarting is to use the following command.

$ nginx -s reload

It simply reloads the NGINX configuration and applies changes without restarting server.

Sometimes you may need to mention full path to NGINX instead of just NGINX command.

Linux 
/etc/init.d/nginx reload

FreeBSD 
/usr/local/etc/rc.d/nginx reload

In this short article, we have learnt how to change NGINX configuration without restarting server.

Also read:

How to Get Selected Text from Dropdown Using jQuery
How to Get Data-ID Attribute Using jQuery
How to Check if Image is Loaded in jQuery
How to Fix Ambiguous Column Names in MySQL
How to List All Foreign Keys to Table in MySQL

Leave a Reply

Your email address will not be published. Required fields are marked *