nginx 报错:nginx: [error] invalid PID number “” in “/run/nginx.pid”

内容纲要

问题

nginx已经安装且正常运行,新增conf文件后,使用命令检查无问题,但是执行nginx -s reload 后报错:


# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

# nginx -s reload
nginx: [error] invalid PID number "" in "/run/nginx.pid"

解决方案

# 注意:/etc/nginx/nginx.conf是你实际的配置文件全路径
nginx -c /etc/nginx/nginx.conf

# 然后执行nginx -s reload
nginx -s reload

发表评论

您的电子邮箱地址不会被公开。 必填项已用 * 标注

滚动至顶部