繁体   English   中英

服务nginx重新启动失败

[英]service nginx restart fails

我通过运行nginx -t检查了配置语法,然后得到了结果:

nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

但是,当我运行service nginx restart会失败。

我在启用了sites的文件夹中有一个名为a.com的配置文件,内容如下:

server {
    listen 80 default_server;
    listen [::]:80 default_server ipv6only=on;

    server_name a.com;

    # root /usr/share/nginx/html;
    # index index.html index.htm;
    root /home/a/public;

    client_max_body_size 10G;

    location / {
        proxy_pass http://localhost:3000;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $http_host;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_buffering off;
    }
}

我在Ubuntu 14.10上,想要部署Rails服务器。

我手动杀死了nginx的进程,然后再次启动nginx,解决了问题。

我遇到了这个问题,使用sudo解决了这个问题:

sudo service nginx restart

启用日志以检查错误可能会有所帮助:

https://www.nginx.com/resources/admin-guide/logging-and-monitoring/

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM