Skip to content
This repository has been archived by the owner on May 15, 2021. It is now read-only.

Invalid HTTP_HOST header: '127.0.0.1'. You may need to add '127.0.0.1' to ALLOWED_HOSTS. #35

Open
micah opened this issue Sep 14, 2020 · 2 comments

Comments

@micah
Copy link

micah commented Sep 14, 2020

Hello,

I tried to deploy using the docker-compose method you detail.

I configured my .env file with:

DJANGO_ALLOWED_HOSTS=['127.0.0.1']

but then when I try to visit http://127.0.0.1:8079, I get a 400 level error, and the following in the docker logs:

ERROR 2020-09-14 17:59:00,229 exception 16 140629607933760 Invalid HTTP_HOST header: '127.0.0.1:8079'. You may need to add '127.0.0.1' to ALLOWED_HOSTS.

I tried adding 127.0.0.1:8079 there, but that didn't work.

thought the problem might have been the port, so I tried to change the port in the docker-compose.yml to just map 80, but I still get this:

ERROR 2020-09-14 18:04:28,490 exception 17 140046465333056 Invalid HTTP_HOST header: '127.0.0.1'. You may need to add '127.0.0.1' to ALLOWED_HOSTS.

@micah
Copy link
Author

micah commented Sep 14, 2020

I also tried to set the specific IP of the server in there, but I get the same error, with the IP there instead.

@christianlupus
Copy link
Contributor

Have you recreated the docker container? (Sorry, I do not know if you are familiar with the containers/docker.)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants