I'm running into some permission issues with uwsgi and nginx running on Ubuntu 14. I get a 502 bad gateway error.I'm logged in as root but top -c tells me that uwsgi is runned as www-data (don't know if this is important).my vi /etc/uwsgi/apps-enabled/mysite.ini looks like:[uwsgi]vhost = truesocket = /tmp/mysite.sockvenv = /var/www/mysite/.envchdir = /var/www/mysitemodule = manage2callable = applicationrunning uwsgi --socket 0.0.0.0:8000 --protocol=http -w manage2 works perfectly/etc/nginx/sites-enabled/mysite :server {    listen 80;    server_tokens off;    server_name 140.58.135.92;     location / {         include uwsgi_params;         uwsgi_pass unix:/tmp/mysite.sock;     }     location /static {         alias /var/www/mysite/static;     }     ## Only requests to our Host are allowed     if ($host !~ ^(140.58.135.92)$ ) {        return 444;     }}The /var/log/ngnix/error.log file tells me:2016/11/02 09:46:05 [error] 10713#10713: *1 connect() to unix:/tmp/mysite.sock failed (111: Connection refused) while connecting to upstreamThe permission for mysite.sock is:-rwxr--r-- 1 www-data root    0 Nov  2 10:47 mysite.sock
uwsgi nginx , problem with accessing socket file on ubuntu --> 502 bad gateway error
ubuntu;permissions;nginx;socket;uwsgi