一、检查nginx配置文件语法有无错误
[[email protected] conf]# /application/nginx/sbin/nginx -t
nginx: the configuration file /application/nginx-16.0/conf/nginx.conf syntax is ok
nginx: configuration file /application/nginx-16.0/conf/nginx.conf test is successful
二、平滑重启并失败
[[email protected] conf]# /application/nginx/sbin/nginx -s reload
nginx: [error] invalid PID number "" in "/application/nginx-16.0/logs/nginx.pid"
三、使用此命令:/application/nginx/sbin/nginx -c /application/nginx-16.0/conf/nginx.conf
[[email protected] conf]# /application/nginx/sbin/nginx -c /application/nginx-16.0/conf/nginx.conf
四、平滑重启成功
[[email protected] conf]# /application/nginx/sbin/nginx -s reload
原文地址:https://blog.51cto.com/14078730/2420859
时间: 2024-10-05 00:08:30