nginx: [error] open() 错误解决办法

需要停止或者重启nginx的命令如下

[plain] view plain copy

/usr/local/nginx/sbin/nginx -s stop  
/usr/local/nginx/sbin/nginx -s reload  

发现报以下错误:

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

解决办法,执行以下语法即可修复:

[plain] view plain copy

/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf  

原理:

使用nginx -c的参数指定nginx.conf文件的位置

转载于:https://blog.51cto.com/coolner/2109029

你可能感兴趣的:(nginx: [error] open() 错误解决办法)