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

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

问题描述

我正在尝试修改 Nginx 配置文件以删除重写".

I am trying to modify the Nginx config file to remove a "rewrite".

目前,我有这个配置文件:

Currently, I have this config 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 config file, I tried

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

在日志文件中,有一行

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天全站免登陆