I edited /etc/systemd/system/gunicorn.service and /etc/nginx/sites-enabled/default and changed django_project to my project name, restarted gunicorn and got the Bad Gateway error. Where do I start to search?
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.
Hi there,
It sounds like that the Django service is not running. I could suggest following the steps here on how to troubleshoot common problems with Django:
https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-16-04
Mainly try out the following commands:
Usually, 502 is returned by Nginx when it fails to connect to the backend service, which indicates that it is either a problem with the Nginx configuration or the backend service is unavailable.
Here is a quick video on how to troubleshoot a 502 error, though it uses Docker as an example:
Regards, Bobby