Report this

What is the reason for this report?

502 Bad Gateway when following Django Nginx Ubuntu 16.04 guide

Posted on November 18, 2016

I’m following this guide. The development methods for serving my Django app work (using python manage.py runserver and gunicorn --bind 0.0.0.0:8000 myproject.wsgi:application), but when I set up the systemd and Nginx configuration files, I just get a 502 Nginx error page. I believe that Nginx is supposed to create the relevant .sock file at some point, but I don’t see one in my project directory.

Ultimately, I would actually like my Django app to be served on a subdirectory of the domain, like mysite.com/sub/, since there is a website currently being served on the root domain.

Your help is greatly appreciated,

Nathan



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.

stuck here too…really annoying

I have have exactly the same problem as well. A little help with be really appreciated.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.