Django apps rely on the host header for certain links etc.
In my setup I have a django app running behind nginx as reverse proxy (with a non-default server_name
)
According to:
https://docs.djangoproject.com/en/3.1/topics/security/#host-header-validation
For instance, even if Apache is configured such that your Django site is served from a non-default virtual host with the ServerName set, it is still possible for an HTTP request to match this virtual host and supply a fake Host header
I could not find any information on if or how it can be done in nginx.
Is it really unsafe to allow blindly in the webapp relying on the header coming from nginx?