Http -> https redirection in a Django + Gunicorn + Nginx application

For the http -> https redirection, I am going through the tutorial https://realpython.com/django-nginx-gunicorn/#redirecting-http-to-https

Though the tutorial suggests changes in nginx configuration file but it does not suggest any changes in project's settings.py as mentioned in the stackoverflow thread.

https://docs.djangoproject.com/en/2.2/topics/security/#ssl-https suggests the following:

For the case of a reverse proxy, it may be easier or more secure to configure the main Web server to do the redirect to HTTPS.

Is it that since nginx is used a reverse proxy server in the realpython tutorial, there's no need to make any corresponding change in django's setting.py?

Back to Top