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

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


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.dprintf "[Service]\nExecStartPost=/bin/sleep 0.1\n" > /etc/systemd/system/nginx.service.d/override.confsystemctl daemon-reloadsystemctl 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!