【发布时间】:2019-01-08 14:07:27
【问题描述】:
当我检查 Nginx 的状态时
sudo service nginx status
Aug 01 12:35:07 iz2ze9wve43n2nyuvmsfx5z systemd[1]: Starting The nginx HTTP and reverse proxy server...
....
Aug 01 12:35:07 iz2ze9wve43n2nyuvmsfx5z systemd[1]: Failed to read PID from file /run/nginx.pid: Invalid argument
Aug 01 12:35:07 iz2ze9wve43n2nyuvmsfx5z systemd[1]: Started The nginx HTTP and reverse proxy server.
它报告“无法从文件/run/nginx.pid中读取PID:无效参数”
但是,我的网站运行正常,
我的 custom_nginx.conf
server {
listen 80;
server_name *.example.com 39.105.51.**;
charset utf-8;
location / {
uwsgi_read_timeout 30;
uwsgi_pass 127.0.0.1:8200;
include uwsgi_params;
}
location /media/ {
alias /usr/share/nginx/html/;
autoindex on;
}
location /static/ {
alias /root/forum/dst_static/;
}
}
我可以毫无错误地访问 www.example.com 和 39.105.51.**。
我应该忽略它,什么样的错误在等着我?
【问题讨论】:
-
你不应该忽略它。由于缺少访问权限,即
/run/,可能会发生此类错误。也可能是该目录不存在,但在/var/下为/var/run。以后的脚本可能会失败,即重新启动或停止服务,如果它们依赖于从 PID 文件中读取的 PID。 -
非常感谢您的cmets,请您转发回答。 @U880D