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
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐