question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Invalid HTTP_HOST header in Docker Local

See original GitHub issue

I tried deploying cookie cutter app using Docker locally.

At this step of running

docker-compose -f dev.yml

Everything is fine, but when accessing http://dockerbox:8000, I got following error

django.core.exceptions.DisallowedHost: Invalid HTTP_HOST header: 'dockerdev:8000'. You may need to add 'dockerdev' to ALLOWED_HOSTS.

I already set dockerdev in local.py ALLOWED_HOSTS=‘.dockerdev’ *dockerdev: is my docker machine box set in /etc/hosts

Any help?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
daniel374commented, Aug 11, 2018

Inside the settings.py file: ALLOWED_HOSTS = [‘192.168.99.100’]

0reactions
Afrowavecommented, Aug 11, 2018

@daniel374 is referring to the docker machine that one starts up asdefault. It would be started up as on the CLI:

docker-machine start default
Read more comments on GitHub >

github_iconTop Results From Across the Web

Invalid HTTP_HOST header in Docker Local #879 - GitHub
I tried deploying cookie cutter app using Docker locally. ... django.core.exceptions.DisallowedHost: Invalid HTTP_HOST header: 'dockerdev:8000'.
Read more >
Invalid HTTP_HOST header: 'products_web:8001& ...
The warning is to tell you that underscore (_) is not valid in a hostname. The most common place you see underscores in...
Read more >
DisallowedHost at /, Invalid HTTP HOST header in Django ...
Solution/Fix: Disallowed Host at /address, Invalid HTTP HOST header in Python Django Docker Google Cloud Run App Allowed_Hosts Issue.
Read more >
What is this “Invalid Host Header” error? | by Avinash Thakur
This error is most commonly caused by a misconfiguration of the application server that causes it to reject non-local connections.
Read more >
Configuring a registry - Docker Documentation
The url to access the metrics is HOST:PORT/path , where HOST:PORT is defined in addr under debug . headers. The headers option is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found