Welcome! Log In Create A New Profile

Advanced

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

Francis Daly
September 18, 2017 11:20AM
On Mon, Sep 18, 2017 at 02:43:37AM -0400, sandyman wrote:

Hi there,

> I am trying to deploy my project to a production environment

It looks like you have been trying lots of different things, and changing
some things each time.

It will probably be simpler for you if you find one tutorial on how to
use nginx to front django, and follow exactly that one. Do not try to
mix pieces from two or more until you understand what every config line
means; otherwise you will probably become confused.

> 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 .

First: decide do you want django to present itself on a unix socket,
or on a tcp port.

Next: decide do you want django to present itself as a uwsgi service,
or as a http service.

Then: configure django as the server, and configure nginx as the client
talking to that server.

> 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

There are lots of / characters there; they probably are not all needed.

> 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"

That says that nginx thinks that django is presented as a uwsgi service,
on the unix socket /home/workspace/project/tmp/uwsgi.sock.

> [uwsgi]
> socket = /home/workspace/project/uwsgi.sock
> protocol = http

That seems to say that django thinks that django presents itself as a
http service, on the unix socket /home/workspace/project/uwsgi.sock.

The two socket names are different. The two protocols are different. The
client is unlikely to successfully talk to the server, under those
conditions.

f
--
Francis Daly francis@daoine.org
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
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: 177
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready