当重启或关闭nginx的时候报错说没有pid文件,查看一下真的没有

nginx: [error] open() "/usr/local/nginx/logs/nginx.pid" failed (2: No such file or directory)_配置文件

nginx: [error] open() "/usr/local/nginx/logs/nginx.pid" failed (2: No such file or directory)_再启动_02

 

查看下配置文件,发现pid没有打开,解注释后再启动nginx就行了(若已开启,直接pkill nginx 再启动)

nginx: [error] open() "/usr/local/nginx/logs/nginx.pid" failed (2: No such file or directory)_配置文件_03