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

September 23, 2016 2.4k views
Nginx Deployment Python Ubuntu

Hello, I am trying to deploy my flask app and I have followed everything from this tutorial
https://www.digitalocean.com/community/tutorials/how-to-serve-flask-applications-with-gunicorn-and-nginx-on-ubuntu-16-04

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

etc/systemd/system/myproject.service

[Unit]
Description=Gunicorn instance to serve my-page
After=network.target

[Service]
User=jb
Group=www-data
WorkingDirectory=/home/jb/webjosue/my-page
Environment="PATH=/home/jb/webjosue/FlaskENV/bin"
ExecStart=/home/jb/webjosue/FlaskENV/bin/gunicorn --workers 3 --bind unix:/home/jb/webjosue/my-page/my-page.sock -m 007 wsgi:app

[Install]
WantedBy=multi-user.target

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

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

}

1 Answer
Have another answer? Share your knowledge.