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

Errors trying to start nginx after updating Ubuntu

我正在尝试对我的 nginx 进行故障排除,但并不顺利。 我从 运行ning 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 上进行此操作,如果有帮助的话

如错误所说.. unknown directive "passenger_enabled"

nginx_aggrigator.conf:164

所以首先检查这个文件: /etc/nginx/sites-enabled/nginx_aggrigator.conf

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