I deployed a Django App to AWS Elastic Beanstalk and I’m getting “Invalid HTTP_HOST header” error even when I’ve added it to my allowed hosts settings.
I’m getting this error:
Invalid HTTP_HOST header: 'recordings-env.kf4qfzaijd.us-west-2.elasticbeanstalk.com'. You may need to add 'recordings-env.kf4qfzaijd.us-west-2.elasticbeanstalk.com' to ALLOWED_HOSTS.
This is what I have in my settings.py
ALLOWED_HOSTS = [
I think the problem is that my settings aren’t being updated, because isn’t working either if I put
ALLOWED_HOSTS = ['*']. I left
DEBUG = True and in request information I’m getting:
after modifying it I run eb deploy without errors.
I’ve realized that my changes wasn’t being deployed because I needed to commit first and I didn’t know that (my first time deploying to eb). So, that was the problem.