title: 502 Bad Gateway - django + nginx + gunicorn - sock failed (13: Permission denied)
body: <p>I am following this tutorial: <a href="https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-14-04" rel="noreferrer">https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-14-04</a></p>
  
  <p>I believe everything else in my setup is correct. The file /var/log/nginx/error.log has many of the following error:</p>
  
  <p>2015/12/19 18:41:58 [crit] 10850#0: *23 connect() to unix:/home/root/myproject/myproject.sock failed <strong>(13: Permission denied)</strong> while connecting to upstream, client: [[my ip]], server: [[server ip]], request: "GET / HTTP/1.1", upstream: "<a href="http://unix:/home/root/myproject/myproject.sock:/" rel="noreferrer">http://unix:/home/root/myproject/myproject.sock:/</a>", host: "[[server ip]]"</p>
  
  <p>The command:</p>
  
  <pre><code>/home/root/myproject ls -l /home/root/classNote/classNote.sock
  </code></pre>
  
  <p>outputs:</p>
  
  <pre><code>srwxrwxrwx 1 root www-data 0 Dec 19 18:17 /home/root/myproject/myproject.sock
  </code></pre>
  
  <p>EDIT: Andrei's comment's response:</p>
  
  <p>the command:</p>
  
  <pre><code>ps ax | grep gunicorn
  </code></pre>
  
  <p>outputs:</p>
  
  <pre><code>  847 ?        Ss     0:00 /home/root/myproject/myprojectEnv/bin/python myprojectEnv/bin/gunicorn --workers 3 --bind unix:/home/root/myproject/myproject.sock myproject.wsgi:application
    921 ?        S      0:00 /home/root/myproject/myprojectEnv/bin/python myprojectEnv/bin/gunicorn --workers 3 --bind unix:/home/root/myproject/myproject.sock myproject.wsgi:application
    923 ?        S      0:00 /home/root/myproject/myprojectEnv/bin/python myprojectEnv/bin/gunicorn --workers 3 --bind unix:/home/root/myproject/myproject.sock myproject.wsgi:application
    928 ?        S      0:00 /home/root/myproject/myprojectEnv/bin/python myprojectEnv/bin/gunicorn --workers 3 --bind unix:/home/root/myproject/myproject.sock myproject.wsgi:application
   1136 pts/0    S+     0:00 grep gunicorn
  </code></pre>