Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid HTTP_HOST header #19

Closed
jpmckinney opened this issue Aug 29, 2019 · 10 comments
Closed

Invalid HTTP_HOST header #19

jpmckinney opened this issue Aug 29, 2019 · 10 comments

Comments

@jpmckinney
Copy link
Member

Invalid HTTP_HOST header: '46.43.2.235'. You may need to add '46.43.2.235' to ALLOWED_HOSTS.
Invalid HTTP_HOST header: '46.43.2.235:443'. You may need to add '46.43.2.235' to ALLOWED_HOSTS.
Invalid HTTP_HOST header: 'live.standard-search.opencontracting.uk0.bigv.io'. You may need to add 'live.standard-search.opencontracting.uk0.bigv.io' to ALLOWED_HOSTS.

Let's add these to the allowed hosts (the IP is for the standard-search server).

@odscjames
Copy link
Contributor

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

Is there a use case for this one? Currently I think the only reason we would see this is bots trying to crawl us. (In fact, on a lot of our servers we set up an default apache placeholder site for bots to see).

Invalid HTTP_HOST header: 'live.standard-search.opencontracting.uk0.bigv.io'. You may need to add 'live.standard-search.opencontracting.uk0.bigv.io' to ALLOWED_HOSTS.

www.live.standard-search.opencontracting.uk0.bigv.io is however already set up as an ALLOWED_HOSTS and an SSL cert name - for the same avoiding-bots reason as above, can we leave it as this?

@jpmckinney
Copy link
Member Author

Aha. Is there a way to quiet specific HTTP_HOST errors, so that we don't continually get new reports in Sentry?

@odscjames
Copy link
Contributor

I see the problem - we do have an default host in place for HTTP crawlers, but not for HTTPS crawlers - ie h t t p://46.43.2.235/ gets placeholder, h t t p s://46.43.2.235/ gets site and generates a sentry error.

We can look into that.

@odscjames
Copy link
Contributor

@jpmckinney jpmckinney changed the title Invalid HTTP_HOST header standard-search: Invalid HTTP_HOST header Sep 28, 2019
@jpmckinney jpmckinney added the S: docs Relating to the OCDS documentation server label Oct 2, 2019
@jpmckinney
Copy link
Member Author

jpmckinney commented Oct 28, 2019

This has been solved in a few different ways:

For now I ignored them until 2038-01-19 03:14 in Sentry.

jpmckinney added a commit that referenced this issue Oct 28, 2019
@jpmckinney jpmckinney changed the title standard-search: Invalid HTTP_HOST header Invalid HTTP_HOST header Oct 28, 2019
@jpmckinney jpmckinney removed the S: docs Relating to the OCDS documentation server label Oct 28, 2019
@jpmckinney
Copy link
Member Author

Also occurs on Data Review Tool (and presumably any Django app with Sentry installed).

@odscjames
Copy link
Contributor

Commented in our deploy repository in https://github.com/OpenDataServices/deploy/issues/6

@jpmckinney
Copy link
Member Author

jpmckinney commented Apr 23, 2020

I'm reconfiguring loggers.

@jpmckinney
Copy link
Member Author

Done and deployed. There's an open PR for standard-search. Once closed, we can resolve the open issues in Sentry.

@Bjwebb
Copy link
Contributor

Bjwebb commented Jul 9, 2020

PR for standard-search is merged now.

Looks to me like all the open issues in Sentry are gone already.

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

No branches or pull requests

3 participants