Question

Error 404 when I slugify my url NGINX

Posted December 16, 2020 96 views
NginxDjango

I was following this tutorial on how to deploy on digital ocean(Link) .Nginx is able to find all the urls other then the one which I had slugified(Website Link). I am able to load the website locally using gunicorn so I am guessing the issue is with NGINX.

Thank you for your help!!

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.

×
Submit an Answer
1 answer

Hi there @tristanlimyj,

Can you share the exact Nginx server block configuration that you are using?

You need to make sure that you have the proxy_params file which contains the following proxy rules:

proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;

I could suggest taking a look at this handy Nginx Config tool that let’s you generate your Nginx configuration:

https://www.digitalocean.com/community/tools/nginx

Regards,
Bobby