(111: Connection refused) while connecting to upstream NGINX Uwsgi

sandyman nginx-forum at forum.nginx.org
Mon Sep 18 06:43:37 UTC 2017


after struggling for almost a week on this I feel I need to reach out for
assistance . Please Help

I am trying to deploy my project to a production environment 


In terms of permissions I have read all the forums changed all permissions
i.e. 777 etc etc
srwxrwxrwx  uwsgi.sock  (owned by me full access ) !!
I've checked over and over all the directory structures etc. Ive swtiched
from unix sockets to http but still 
no joy . 

exact error 


2017/09/18 06:32:56 [error] 15451#0: *1 connect() to
unix:////home/workspace/project//
tmp/uwsgi.sock failed (111: Connection refused) while connecting to
upstream, client: 1933
.247.239.160, server: website.xyz, request: "GET / HTTP/1.0", upstream:
"uwsgi://unix:////
/home/workspace/project/tmp/uwsgi.sock:", host: "www.website.xyz"


Nginx configuration:

upstream _django {
    server unix:////home/workspace/project/tmp/uwsgi.sock;
}

server {
   listen 62032;
   server_name website.xyz www.website.xyz ;

   location = /favicon.ico { access_log off; log_not_found off; }
   location = /test-this { return 200 "Yes, this is correct\n"; }
   location /foo { return 200 "YIKES  what a load of codswollop";}
   root  /home/workspace/project;

   location /static {
      alias   /home/workspace/project/testsite/assets;
    }

   location /assets {
      root   /home/workspace/project/testsite/assets;
    }

    location / {
        include /home/workspace/project/uwsgi_params;
        #include uwsgi parameters.
        uwsgi_pass _django;
        #tell nginx to communicate with uwsgi though unix socket
/run/uwsgi/sock.
    }




uwsgi ini file 

# project.ini file
[uwsgi]
chdir =  /home/workspace/project/testsite
module=testsite.wsgi:application
socket  = /home/workspace/project/uwsgi.sock
chmod-socket    = 666
daemonize = /home/workspace/project/tmp/uwsgi.log
protocol = http
master = true
vacuum=true
max-requests=5000
processes = 10


start script 

#! /bin/bash
PIDFILE=/home/workspace/project/startselvacura.pid

source /home/workspace/project/venv/bin/activate
uwsgi --ini /home/workspace/project/uwsgi-prod.ini --venv
/home/workspace/project/venv  --pidfile $PIDFILE
~                            



running https://www.asandhu.xyz/foo

does return the  expected result :

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,276427,276427#msg-276427



More information about the nginx mailing list