Job for nginx.service failed because the control process exited with error code.

2023-06-10,,

1. nginx启动报错:

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

这个错误是nginx.conf配置文件里面配置错误,可以使用命令检查在哪里出错

nginx -t

出错的地方:

nginx: [emerg] invalid number of arguments in "proxy_pass" directive in
/etc/nginx/conf/nginx.conf:82

进行改正,并再次检查。输出以下信息表示ok。

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

启动nginx:

systemctl start nginx

建议每次更改配置文件都先执行命令检查一下配置文件是否配置成功。

2.nginx相关命令
查看nginx启动状态

systemctl status nginx

重启加载nginx

systemctl reload nginx

强制重启nginx

systemctl restart nginx

停止nginx

systemctl stop nginx

禁用nginx

systemctl disable nginx

Job for nginx.service failed because the control process exited with error code.的相关教程结束。

《Job for nginx.service failed because the control process exited with error code..doc》

下载本文的Word格式文档,以方便收藏与打印。