INCF / biostar-central

DEPRECATED, please go to upstream on
http://github.com/ialbert/biostar-central
Other
4 stars 4 forks source link

Invalid HTTP_HOST header #40

Closed brainstorm closed 10 years ago

brainstorm commented 10 years ago

As neurostars.org admin, I'm regularly getting the following email notifications:

[Django] ERROR: Invalid HTTP_HOST header: 'www.daydaydata.com'.
You may need to add u'www.daydaydata.com' to ALLOWED_HOSTS.

No stack trace available

Request repr() unavailable.

We should filter those out as explained here, adding it to our deployment process on ansible-biostar:

http://stackoverflow.com/questions/18220519/how-to-disable-djangos-invalid-http-host-error

ialbert commented 10 years ago

this is a spammer trying to build up their hostname's reputation (google rank).

they made their domain name resolve to your IP, it used to work in the past but thankfull the new django versions will intercept and raise this error

the solution is to have the webserver serve a 404 for all domains other than the ones you wish to allow:

https://github.com/ialbert/biostar-central/blob/master/conf/server/biostar.nginx.conf

On Sun, Jun 22, 2014 at 7:25 AM, Roman Valls Guimerà < notifications@github.com> wrote:

As neurostars.org admin, I'm regularly getting the following email notifications:

[Django] ERROR: Invalid HTTP_HOST header: 'www.daydaydata.com'. You may need to add u'www.daydaydata.com' to ALLOWED_HOSTS.

No stack trace available

Request repr() unavailable.

We should filter those out as explained here, adding it to our deployment process on ansible-biostar:

http://stackoverflow.com/questions/18220519/how-to-disable-djangos-invalid-http-host-error

— Reply to this email directly or view it on GitHub https://github.com/INCF/biostar-central/issues/40.

Istvan Albert Associate Professor, Bioinformatics Pennsylvania State University http://www.personal.psu.edu/iua1/

puntonim commented 10 years ago

What Istvan recommends is clearly the best solution for a high-traffic deployment where a proper (reverse proxy) webserver like Nginx is installed. But so far Neurostars is deployed as a low-traffic website and only a pure python web server (waitress) is installed in a Docker container.

So we have 2 solutions:

What do you think @brainstorm?

brainstorm commented 10 years ago

@nimiq, for now I would just go for option 2 since you have other prios for this week, unless you think you can get the nginx alternative up in less than, say 2h of work.