KVISH
KVISH

Reputation: 13208

uwsgi not creating a socket file

I have the following configuration:

[uwsgi]
vhost = true
plugins = python,logfile
socket = /tmp/mysite.com.sock
master = true
enable-threads = true
processes = 4
wsgi-file = /home/ubuntu/myappwebsite/myapp/myapp/wsgi.py
chdir = /home/ubuntu/myappwebsite/myapp
touch-reload = /home/ubuntu/myappwebsite/myapp/myapp/reload
logger=file:/tmp/uwsgi-error.log
vacuum = true

and for nginx:

server {
listen  80;
server_name mysite.com www.mysite.com;
access_log /var/log/nginx/mysite.com_access.log;
error_log /var/log/nginx/mysite.com_error.log;
client_max_body_size 75M;

location / {
    uwsgi_pass unix:///tmp/mysite.com.sock;
    include uwsgi_params;
}
}

When I look at the nginx logs i see the following:

2016/11/14 01:36:43 [error] 10779#10779: *9 connect() to unix:///tmp/mysite.com.sock failed (111: Connection refused) while connecting to upstream, client: 10.13.142.61, server: mysite.com, request: "GET / HTTP/1.1", upstream: "uwsgi://unix:///tmp/mysite.c

I'm getting the following in my uwsgi log file:

Mon Nov 14 02:08:22 2016 - unable to find logger file

I'm not able to find any issues in the uwsgi logs for some strange reason. Is there anything else i'm missing here? I'm using an EC2 with Ubuntu 16.04 if that helps. I have googled and reconfigured this from scratch again and still to no avail. Please, any help appreciated!

Upvotes: 4

Views: 3986

Answers (1)

Alex
Alex

Reputation: 6047

make sure the owner of the wsgi file is the same as nginx user.

 chown www-data:www-data wsgi.py

Upvotes: 1

Related Questions