Okay guys, so this is the error I'm stuck on for days.I am trying to get my django+nginx+uwsgi work properly but it's been 3 days and it's still not working, I tried a lot,rebuilded the server,tried python2 and 3 and blah blah blah but the error I hook on is the one above.
Here's my uwsgi file
[uwsgi]
project = salesproject
base = /home/ubaid
logto = /var/log/uwsgi/error.log
chdir = %(base)/%(project)
chmod-socket= 777
plugins = python3
wsgi-file = %(project)/wsgi.py
master = true
processes = 2
socket = /var/uwsgi/%(project).sock
virtualenv = %(base)/%(project)/venv
vacuum = true
uid = www-data
gid =www-data
Here's my Nginx conf located in /etc/nginx/sites-available/
server {
listen 80;
server_name 72.14.184.213;
location = /favicon.ico { access_log off; log_not_found off; }
location /static/ {
root /home/ubaid/salesproject;
}
location / {
include uwsgi_params;
uwsgi_pass unix:/var/uwsgi/salesproject.sock;
}
}
Now see how the problem unfolds in steps,
First when I go to my website, 1.It gives me an error like this
connect() to unix:/home/ubaid/var/uwsgi/salesproject.sock failed (2: No such file or directory)
Then I manually make the .sock file by sudo nano .sock so when I run my website,It gives me an error like this
connect() to unix:/var/uwsgi/salesproject.sock failed (13: Permission denied)
Then to resolve this I run sudo chmod 777 .sock so now when I check my file it gives the final error,The big goblin one
and that is
connect() to unix:/var/uwsgi/salesproject.sock failed (111: Connection refused)
Another thing when i run uwsgi --ini, I check my uwsgi logs and the logs are printed but when I go to my website i don't see anything in logs,
Can it be because in reality uwsgi and nginx are not actually talking to each other or something else,whatever it is please help me in resolving this.