By Pades
I am beginner in python development and I first time tried to upload to server DigitalOcean. I followed this tutorial link. But I have a problem when I finished tutorial 502 Bad Gateway nginx/1.10.0 (Ubuntu)
Zlty.ini
[uwsgi]
module = wsgi:app
master = true
socket = zlty.sock
chmod-socket = 660
vacuum = true
die-on-term = true
Zlty.service
[Unit]
Description=uWSGI instance to serve zlty
After=network.target
[Service]
User=dendis
Group=www-data
WorkingDirectory=/home/dendis/zlty
Environment="PATH=/home/dendis/zlty/zltyenv/bin"
ExecStart=/home/dendis/zlty/zltyenv/bin/uwsgi --ini zlty.ini
[Install]
WantedBy=multi-user.target
sites-available
server {
listen 80;
server_name 139.59.145.129;
location / {
include uwsgi_params;
uwsgi_pass unix:/home/dendis/zlty/zlty.sock;
}
}
Log in nginx
2016/07/26 03:53:02 [crit] 9563#9563: *9 connect() to unix:/home/dendis/zlty/zlty.sock failed (2: No such file or directory) while connecting to upstream, client: 188.123.100.136, server: 139.59.145.129, request: "GET / HTTP/1.1", upstream: "uwsgi://unix:/home/dendis/zlty/zlty.sock:", host: "139.59.145.129"
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
When following this tutorial did you complete the section on creating and testing a sample application. This section included temporarily opening port 5000 and ensuring the app is returned. It sounds like the flask application itself is not responding when it is requested by nginx upstream so working from the bottom of the stack should be the best way to identify the issue.
Replace
``` uwsgi_pass unix:/home/jrm2k6/jeremydagorn-blog/jeremydagorn.sock;```
with
```uwsgi_pass unix:///home/jrm2k6/jeremydagorn-blog/jeremydagorn.sock;```
and restart Nginx. It might help you.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.