#4982 (How to avoid "Invalid HTTP_HOST header")

by Luc Saffre · in Hosting (system administration) · assigned to Luc Saffre

Kurzbeschreibung

The new production server is sending lots of emails to ADMINS saying [avanti] ERROR (EXTERNAL IP): Invalid HTTP_HOST header: '12.123.234.56'. You may need to add '12.123.234.56' to ALLOWED_HOSTS.

Kinder

Kommentare

  • 7 Monate, 2 Wochen ago von Luc Saffre about #4982 (How to avoid "Invalid HTTP_HOST header") : We applied @8lurry 's approach on nora. Everything seems to work. We'll see soon whether the issue is gone. I can't really test it because I don't know how to make a get to an IPv6 address...
  • 7 Monate, 2 Wochen ago von Luc Saffre about #4982 (How to avoid "Invalid HTTP_HOST header") : I'm still getting this error about once per day for (immo1 on nora). So we should try Sharif's approach there.
  • 8 Monate ago von Luc Saffre Antwort auf Sharif Mehedi about #4982 (How to avoid "Invalid HTTP_HOST header") : Oho, I didn't yet know this approach, which has the advantage of being easier than what we were doing until now. I noted this in the hosting guide.
  • 8 Monate ago von Luc Saffre Antwort auf Luc Saffre about #4982 (How to avoid "Invalid HTTP_HOST header") : It's not sure whether this was the solution. Maybe it is because the request asked for the IPv6 address (2001:41d0:701:1100::124f). To be observed.
  • 8 Monate ago von Luc Saffre Antwort auf Luc Saffre about #4982 (How to avoid "Invalid HTTP_HOST header") (1 Antwort) : The default conf wasn't active because the file had no .conf suffix. I renamed it to default.conf now.
  • 8 Monate ago von Luc Saffre about #4982 (How to avoid "Invalid HTTP_HOST header") (1 Antwort) : I got this once today for immo1 (which is on nora).
  • 8 Monate ago von Sharif Mehedi about #4982 (How to avoid "Invalid HTTP_HOST header") (1 Antwort) : Recently I put a conf on nginx that return 444 if the server_name is not matched by any of the hosted server. It look like: In the file /etc/nginx/conf.d/00-block-ip.conf: server { listen 80 default_server; listen [::]:80 default_server;
    server_name _;
    return 444; }
    server { li...
  • 1 Jahr, 10 Monate ago von Luc Saffre about #4982 (How to avoid "Invalid HTTP_HOST header") (1 Antwort) : It now happens on laudate after my recent changes for fixing the www problem.