Stop Django Invalid HTTP_HOST header errors at Traefik + Elastic Load Balancer level

Viewed 123

I am running a Django app on Elastic Container Service behind Elastic Load Balancer with Traefik. I am seeing a ton of Invalid HTTP_HOST header errors at the Django App level that look like:

Invalid HTTP_HOST header: '34.237.89.13'. You may need to add '34.237.89.13' to ALLOWED_HOSTS.

How do I block these invalid requests before they get to the Django app? Would I do this with Traefik or at the Elastic load balancer level?

0 Answers
Related