Report this

What is the reason for this report?

Trying to run Nginx with Ubuntu / Python /Django only results in 404 error

Posted on April 13, 2020

Hi, I have set up Ubuntu, Python3.7, Django3.0.2 and Postgres as per the DigitalOcean tutorial on a DigitalOcean server. Gunicorn works and the Nginx server loads but only gets a 404 error from the browser. Has anyone had this error and fixed it, or is there a tutorial I can refer to. I’m new to Nginx. Thanks



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.

Hi @peterdp,

It seems you haven’t configured your server blocks in Nginx properly. DigitalOcean have a pretty good tutorial how to do that. You can check that here :

https://www.digitalocean.com/community/tutorials/how-to-set-up-nginx-server-blocks-virtual-hosts-on-ubuntu-16-04

Additionally, there is another article which can help you with your problem. It’s about configuring Django with Nginx. You can view that here as well

https://www.digitalocean.com/community/tutorials/how-to-serve-django-applications-with-uwsgi-and-nginx-on-ubuntu-14-04

If you experience issues with your application after you’ve checked both articles. Please post your Nginx virtual file for your domain here.

Regards, KDSys

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.