您的位置:首页 > 运维架构 > Nginx

ubuntu 重启 nginx 失败,* Restarting nginx nginx ...fail!

2015-07-08 14:05 676 查看

执行 nginx 重启服务时,提示失败如下:

$ sudo service nginx restart
* Restarting nginx nginx
...fail!


原因是你配置 nginx 的配置文件出了错误

查找错误,处理方法:

$ sudo nginx -t
nginx: [emerg] "location" directive is not allowed
here in /etc/nginx/nginx.conf:11
nginx: configuration file /etc/nginx/nginx.conf
test failed


根据错误信息,修改对应生的配置文件即可。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: