I'm following the http://www.obeythetestinggoat.com/book/chapter_08.html book, and it says to add a unix socket to run nginx server with gunicorn, which i did. This is my nginx file
server {
listen 80;
server_name mydjsuperlist-staging.tk;
location /static {
alias /home/elspeth/sites/mydjsuperlist-staging.tk/static;
}
location / {
proxy_set_header Host $host;
proxy_pass http://unix:/tmp/mydjsuperlist-staging.tk.socket;
}
}
Nginx reloads without any failure and checked it with nginx -t
When i run:
gunicorn --bind unix:/tmp/mydjsuperlist-staging.tk.socket superlists.wsgi:application
It succesfully creates mydjsuperlist-staging.tk.socket file in tmp folder and i get this on my terminal
2016-09-01 18:56:01 [15449] [INFO] Starting gunicorn 18.0
2016-09-01 18:56:01 [15449] [INFO] Listening at: unix:/tmp/mydjsuperlist-staging.tk.socket (15449)
2016-09-01 18:56:01 [15449] [INFO] Using worker: sync
2016-09-01 18:56:01 [15452] [INFO] Booting worker with pid: 15452
Everything seems fine, but when i go to my site mydjsuperlist-staging.tk it gives a (502) bad gateway error. When i was using a port my site was running perfectly. What am i doing wrong over here ?