Nginx报错总结

nginx 报异常"/usr/local/nginx/logs/nginx.pid" failed (2: No such file or directory)处理方法

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

    /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)

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

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


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

 nginx 报异常"/usr/local/nginx/logs/nginx.pid" failed (2: No such file or directory)处理方法

posted @ 2018-08-18 11:35  下划线是我  阅读(181)  评论(0编辑  收藏  举报