Python Forum
Nginx Uwsgi Django 111 Connection refused while connecting to upstream
Thread Rating:
  • 3 Vote(s) - 2.67 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Nginx Uwsgi Django 111 Connection refused while connecting to upstream
#1
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.website.xyz/foo

does return the expected result : .. YIKES what a load of codswollop

Please Assist
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Serial connection connection issue Joni_Engr 15 8,074 Aug-30-2021, 04:46 PM
Last Post: deanhystad
  Docker-compose on Pycharm - Connection refused rstambach 3 3,407 Apr-08-2021, 03:07 AM
Last Post: rstambach
  Connection timed out error when connecting to SQL server kenwatts275 2 3,330 Jun-02-2020, 07:35 PM
Last Post: bowlofred
  instruction refused on a "while loop" sylas 11 7,862 May-22-2017, 08:09 AM
Last Post: sylas
  Nginx Setup Django Postgresql Eclipse Adelton 3 4,149 Mar-27-2017, 09:40 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020