一、检查nginx配置文件语法有无错误
[root@web01 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
二、平滑重启并失败
[root@web01 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
[root@web01 conf]# /application/nginx/sbin/nginx -c /application/nginx-16.0/conf/nginx.conf(这里的路径是-t反馈的信息里)
四、平滑重启成功
[root@web01 conf]# /application/nginx/sbin/nginx -s reload