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

  • Posted April 13, 2020
  • Nginx

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


Submit an 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 :

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

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