How to Reload NGINX configuration without restarting


reload nginx configuration without restarting

When you update NGINX configuration, it’s essential to load the new configuration to apply changes. Typically, admins restart their NGINX web server to use the new configuration. However, this can be problematic in production environments where you need the server to be up all the time. So, instead of restarting your web server, you can reload NGINX configuration without restarting.

 

How to Reload NGINX configuration without restarting

Here are the steps to reload NGINX configuration without restarting.

 

Open a terminal session or SSH into your Linux system and run the following command

For Debian/Ubuntu servers

$ sudo service nginx reload

 

For CentOS/RHEL/Fedora servers
# /etc/init.d/nginx reload

 

If the above commands don’t work for you, you can try the following alternatives

$ sudo systemctl reload nginx

# nginx -s reload

# /path/to/full/nginx -s reload

 

That’s it! Now NGINX will apply new configuration without restarting the server and causing any downtime.

About Sreeram Sreenivasan

Sreeram Sreenivasan is the Founder of Ubiq, a business dashboard & reporting platform for small & medium businesses. Ubiq makes it easy to build business dashboards & reports for your business. Try it for free today!