I start this off with the fact that I am a python developer and I know very little about server management so this is all a learning curve for me.
I created a new Ubuntu 16.04 droplet and I followed this tutorial - https://www.digitalocean.com/community/tutorials/how-to-serve-flask-applications-with-gunicorn-and-nginx-on-ubuntu-16-04. All was well and it worked.
sudo systemctl restart myproject and went to view the server from my browser and I received a 502 error.
Looking at the error log I have this:
2017/01/29 23:21:37 [crit] 18456#18456: *1 connect() to unix:/home/user/myproj/proj.sock failed (2: No such file or directory) while connecting to upstream, client: xx.xx.xx.xx, server: xx.xx.xx.xx, request: “GET / HTTP/1.1”, upstream: “http://unix:/home/user/myproj/proj.sock:/”, host: “xx.xx.xx.xx”
Which suggests there’s no socket file. I ran
ls -al in
/home/user/myproj and I can verify it’s not there. I didn’t delete it so I am not sure what happened to it and how to make it return.
I’ve verified the nginx.conf in /sites-enabled for this project and in the systemctl .service and all the info matches up.
I tried restarting/reloading my project.service, nginx and even a reboot of the server and no luck.
How do I properly return this socket file?
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!
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.
Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.
Click below to sign up and get $200 of credit to try our products over 60 days!