Nginx故障排除

January 11, 2021

nginx.service: Failed to read PID from file /run/nginx.pid: Invalid argument

已解决。遇到此问题是使用DigitalOcean的Ubuntu 18.04 Droplet,检查nginx运行状态 service nginx status 输出标题的错误, 参考StackOverflow解决,步骤(以下均使用root账户):

  • mkdir /etc/systemd/system/nginx.service.d
  • printf "[Service]\nExecStartPost=/bin/sleep 0.1\n" > /etc/systemd/system/nginx.service.d/override.conf
  • systemctl daemon-reload
  • systemctl restart nginx

Copyright © Arcto 2022, Built with Gatsby