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

重启 linux 系统后,启动 nginx,

指令:/usr/local/nginx/sbin/nginx -s reload

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

ls /usr/local/nginx/run/,发现目录为空


解决方法:

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

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

ls /usr/local/nginx/run/


启动 nginx,没有报错了

你可能感兴趣的:(nginx: [error] open() "/usr/local/nginx/run/nginx.pid" failed (2: No such file or directory))