AI智能
改变未来

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

问题:关闭Nginx或重新加载Nginx失败

解决方法:
1、创建nginx.pid文件

cd /usr/local/nginx/logstouch nginx.pid  # 首先进入到上面那个路径创建nginx.pid文件

2、查看nginx的pid

ps -ef |grep nginx

如下图我的pid为2423,注意:要找对应master的pid

3、将pid导入nginx.pid文件

echo 2423 > /usr/local/nginx/logs/nginx.pid

4、nginx关闭成功

./nginx -s stop

赞(0) 打赏
未经允许不得转载:爱站程序员基地 » nginx: [error] open() “/usr/local/nginx/logs/nginx.pid“ failed (2: No such file