重新加载nginx配置 [英] Reload nginx configuration

查看:597
本文介绍了重新加载nginx配置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Nginx conf文件中进行修改以删除重写".

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

现在我有此配置文件:

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;
    }
}

现在我想重新加载该conf文件,我尝试过

Now I want to reload this conf file, I tried

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

在日志文件中有一行 2014/01/22 11:25:25 [notice] 1310#0:信号处理开始

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

但是修改不会加载.

推荐答案

也许您不是以root身份这样做的?

Maybe you're not doing it as root?

尝试sudo nginx -s reload,如果仍然无法正常工作,则可能要尝试sudo pkill -HUP nginx.

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

这篇关于重新加载nginx配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆