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

See original GitHub issue

I used raven package in Django before and it worked well so far. Recently I replaced it with latest sentry-python and getting weird error notifications continuously.

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

I added server domain, 127.0.0.1 and localhost in allowed hosts.

I think there is no direct request to server IP instead of the domain.

Any help to fix the issue is appreciated.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:21 (10 by maintainers)

github_iconTop GitHub Comments

17reactions
untitakercommented, Mar 5, 2020

Yeah this came up a few times before. I think we should just start ignoring that logger, for now you can do:

from sentry.integrations.logging import ignore_logger
ignore_logger("django.security.DisallowedHost")
2reactions
untitakercommented, May 5, 2020

One thing we could do is to add AWS Security Scanners to our list of web crawlers that we offer a filter for: https://docs.sentry.io/accounts/quotas/#inbound-data-filters

Read more comments on GitHub >

github_iconTop Results From Across the Web

python - Invalid http_host header - Stack Overflow
I am trying to develop a website using Django framework and launched using DigitalOcean.com and deployed the necessary files into django-project ...
Read more >
Too many Invalid HTTP_HOST header exception errors
Have you deployed an application to production? Are you getting too many, seemingly random “Invalid HTTP_HOST header” exception errors?
Read more >
Invalid HTTP_HOST header. The domain name provided is ...
Invalid HTTP_HOST header. The domain name provided is not valid according to RFC 1034/1035 · The UNIX socket name must be enclosed in...
Read more >
How to silence "Invalid HTTP_HOST header" error?
This header is originally set by the client. That means that either something (someone) is trying to access your server using a bot/client...
Read more >
Error Invalid http host header | Edureka Community
I am getting the following error : DisallowedHost at / Invalid HTTP_HOST header: '198.211.99.20'. You may need to add u'198.211.99.20' to ...
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