更新Ubuntu后尝试启动Nginx时出错

问题描述 投票:0回答:1

我正在尝试对我的Nginx进行故障排除,并且效果不佳。我先运行sudo systemctl start nginx,然后得到

Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xe" for details.

所以我继续尝试systemctl status nginx.service来获得:

Dec 13 00:29:18  systemd[1]: nginx.service: Control process exited, code=exited status=1
Dec 13 00:29:18  systemd[1]: Failed to start A high performance web server and a reverse proxy server.
Dec 13 00:29:18 systemd[1]: nginx.service: Unit entered failed state.
Dec 13 00:29:18 systemd[1]: nginx.service: Failed with result 'exit-code'

因此,我继续对其进行测试sudo nginx -t -c /etc/nginx/nginx.conf导致

nginx: [emerg] unknown directive "passenger_enabled" in /etc/nginx/sites-enabled/nginx_aggrigator.conf:164
nginx: configuration file /etc/nginx/nginx.conf test failed

我正在ubuntu 16.04上运行它,如果有帮助的话

nginx ubuntu-16.04 nginx-config
1个回答
0
投票

就像错误说。unknown directive "passenger_enabled"

nginx_aggrigator.conf:164

因此,首先检查该文件:/etc/nginx/sites-enabled/nginx_aggrigator.conf

并查看第164行,找到您声明passenger_enabled的部分,因为这是您的错误所在。

© www.soinside.com 2019 - 2024. All rights reserved.