Question

gunicorn not starting

hello everyone.

not sure why but i get a 502 gateway nginx 1.10 error when i go to my ip. i just uploaded my files to home/django/django_project. i am guessing the problem is from gunicorn because nothing happens when i type the command service gunicorn restart via putty in the commandline

here is my nginx file

[error] 26244#26244: *674 connect() to unix:/home/django/gunicorn.socket failed (111: Connection refused) while connecting to upstream, client: 110.170.170.250, server: _, request: “HEAD http://67.207.87.22:80/PMA2014/ HTTP/1.1”, upstream: “http://unix:/home/django/gunicorn.socket:/PMA2014/”, host: “67.207.87.22” 2017/07/20 12:03:57 [error] 26244#26244: *674 connect() to unix:/home/django/gunicorn.socket failed (111: Connection refused) while connecting to upstream, client: 110.170.170.250, server: _, request: “HEAD http://67.207.87.22:80/PMA2015/ HTTP/1.1”, upstream: “http://unix:/home/django/gunicorn.socket:/PMA2015/”, host: “67.207.87.22” 2017/07/20 12:03:57 [error] 26244#26244: *674 connect() to unix:/home/django/gunicorn.socket failed (111: Connection refused) while connecting to upstream, client: 110.170.170.250, server: _, request: “HEAD http://67.207.87.22:80/PMA2016/ HTTP/1.1”, upstream: “http://unix:/home/django/gunicorn.socket:/PMA2016/”, host: “67.207.87.22” 2017/07/20 12:03:57 [error] 26244#26244: *674 connect() to unix:/home/django/gunicorn.socket failed (111: Connection refused) while connecting to upstream, client: 110.170.170.250, server: _, request: “HEAD http://67.207.87.22:80/PMA2017/ HTTP/1.1”, upstream: “http://unix:/home/django/gunicorn.socket:/PMA2017/”, host: “67.207.87.22” 2017/07/20 12:03:58 [error] 26244#26244: *674 connect() to unix:/home/django/gunicorn.socket failed (111: Connection refused) while connecting to upstream, client:

Would appreciate it if someone could point me to the right direction. Thanks


Submit an answer

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!

Sign In or Sign Up to Answer

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.

Accepted Answer

Hi @iknwosu3

Correct, the problem is somewhere in Gunicorn, so we’re not going to get much from Nginx. Make sure you’ve activated error logging: http://docs.gunicorn.org/en/stable/settings.html#errorlog Depending on your installation, sometimes it’s already enabled and you’ll find the log somewhere in your app directory or /var/log/gunicorn.log

Want to learn more? Join the DigitalOcean Community!

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.

@iknwosu3

What’s the value of ExecStart in /etc/systemd/system/gunicorn.service?