title: Gunicorn with unix socket not working gives 502 bad gateway
body: <p>I'm following the <a href="http://www.obeythetestinggoat.com/book/chapter_08.html" rel="nofollow">http://www.obeythetestinggoat.com/book/chapter_08.html</a> book, and it says to add a unix socket to run nginx server with gunicorn, which i did.
  This is my nginx file</p>
  
  <pre><code>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;
  }
  } 
  </code></pre>
  
  <p>Nginx reloads without any failure and checked it with nginx -t </p>
  
  <p>When i run:</p>
  
  <pre><code>gunicorn --bind unix:/tmp/mydjsuperlist-staging.tk.socket superlists.wsgi:application
  </code></pre>
  
  <p>It succesfully creates mydjsuperlist-staging.tk.socket file in tmp folder and i get this on my terminal</p>
  
  <pre><code>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
  </code></pre>
  
  <p>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 ?</p>