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 oknginx: 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
来源地址:https://blog.csdn.net/m0_50176078/article/details/126947631