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
Related posts:
How to Redirect 403 to 404 in NGINX
How to Fix NGINX Bind to 0.0.0.0:80 Failed Error
NGINX Pass Headers from Proxy Server
How to Serve Static Files from Different Folder in NGINX
NGINX Prevent Host Header Attack
How to Count Unique IPs & Requests per IP in NGINX
How to Modify Response Header in NGINX
Difference between $host and $http_host in NGINX
Sreeram has more than 10 years of experience in web development, Python, Linux, SQL and database programming.