Reload nginx configuration

dev691 picture dev691 · Jan 22, 2014 · Viewed 97k times · Source

I am trying to make modification in the Nginx conf file to remove a "rewrite".

Now I have this configuration file:

worker_processes  1;

events {
    worker_connections  1024;
}


http {
    include       mime.types;
    default_type  application/octet-stream;
    sendfile        on;
    keepalive_timeout  65;
    server {
        listen      80;
        server_name amc.local;
        return 301 https://$host:8443/index.html;
    }
}

Now I want to reload this conf file, I tried

nginx -s reload
nginx -c <conf file>
nginx -s stop/start

In the log file there is the line 2014/01/22 11:25:25 [notice] 1310#0: signal process started

But the modifications are not load.

Answer

cnst picture cnst · Jan 23, 2014

Maybe you're not doing it as root?

Try sudo nginx -s reload, if it still doesn't work, you might want to try sudo pkill -HUP nginx.