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

前端 未结 1 1312
南方客
南方客 2020-12-23 14:11

I\'m working through https://www.digitalocean.com/community/tutorials/how-to-serve-django-applications-with-uwsgi-and-nginx-on-ubuntu-16-04. I\'ve completed the tut but I\'m

相关标签:
1条回答
  • 2020-12-23 14:45

    That warning with the nginx.pid file is a know bug (at least for Ubutnu if not for other distros as well). More details here: https://bugs.launchpad.net/ubuntu/+source/nginx/+bug/1581864

    Workaround (on a ssh console, as root, use the commands bellow):

    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 
    

    Then check if you still see that nginx.pid error and also if nginx is actually running and if you can connect to port 80 on your server.

    I would also check if this actually exists and the permissions on it:

    /run/uwsgi/mysite3.sock
    

    If nginx is running and uWSGI is running as well then I guess it's a configuration problem

    I understand you want to use Django so I would recommend to review your actual configuration and compare it with the one from here:

    http://uwsgi-docs.readthedocs.io/en/latest/tutorials/Django_and_nginx.html

    I hope it helps!

    0 讨论(0)
提交回复
热议问题