configuration - 重新加载 Nginx 配置

标签 configuration nginx webserver

我正在尝试修改 Nginx 配置文件以删除“重写”。

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

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

现在我想重新加载这个配置文件,我尝试过

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

在日志文件中,有一行

2014/01/22 11:25:25 [notice] 1310#0: signal process started

但修改未加载。

最佳答案

也许您不是以 root 身份执行此操作?

尝试sudo nginx -s reload,如果仍然不起作用,您可能需要尝试sudo pkill -HUP nginx

关于configuration - 重新加载 Nginx 配置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21292533/

相关文章:

docker - nginx proxy_pass 导致 404 Not Found 页面

apache - 如何在 Apache 中为 HTTP 基本身份验证响应设置 Access-Control-Allow-Origin header ?

azure - 如何查看 Azure 应用服务 Web 应用上的最终 appSettings 值?

java - 启用 webmvc 时,基于 Spring Java 的配置和 JUnit 不起作用

mysql - 如何在openempi中配置mysql?

ASP.NET MVC 和 httpRuntime 执行超时

python - 为什么我的 uWSGI 找不到我的 Django 应用程序?

ruby-on-rails - 生产中 wkhtmltopdf-binary gem 的问题

python - 概述解决方案堆栈

node.js - 使用 Apache Kafka 进行日志聚合