nginx使用service nginx restart报错
启动nginx服务时如果遇到这个错误 Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xe" for details.
可能原因:
1、配置文件语法有误,执行nginx -t
查看输出提示信息 并检查端口是否被占用netstat -tnlp
2、nginx的配置文件nginx.conf中监听了其他端口,这些端口的子进程仍然运行,导致端口占用。需要首先关闭子进程,才能使用该命令。
此时可以kill -9 pid 。
补充: