502 nginx error (2: No such file or directory) while connecting to upstream

Posted September 23, 2016 20.7k views

Hello, I am trying to deploy my flask app and I have followed everything from this tutorial

but when I am on the last step to load my page by the IP address I get a 502

I checked the log and this is what I have
connect() to unix:/home/jb/webjosue/my-page/my-page.sock failed (2: No such file or directory) while connecting to upstream

and these are my files


Description=Gunicorn instance to serve my-page

ExecStart=/home/jb/webjosue/FlaskENV/bin/gunicorn –workers 3 –bind unix:/home/jb/webjosue/my-page/my-page.sock -m 007 wsgi:app


server {
listen 80;
server_name (ip address here);

location / {
    include proxy_params;
    proxy_pass http://unix:/home/jb/webjosue/my-page/my-page.sock;


These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer