Welcome! Log In Create A New Profile

Advanced

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

September 18, 2017 02:43AM
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 :
Subject Author Posted

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

sandyman September 18, 2017 02:43AM

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

Anoop Alias September 18, 2017 02:50AM

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

Francis Daly September 18, 2017 11:20AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 73
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready