I keep getting this error in Apache’s error log:
[client 127.0.0.1] Client sent malformed Host header
exactly every 5 minutes. This happens since we installed Varnish on our server, but I can’t understand why and how to fix it. I even tried to set Apache’s error_log verbosity to debug, but no other useful information is provided. Any idea?
Our Varnish configuration is very basic:
backend default {
.host = "127.0.0.1";
.port = "9001";
}
sub vcl_recv {
remove req.http.X-Forwarded-For;
set req.http.X-Forwarded-For = client.ip;
}
We have several virtualhost that run on port 9001.
Can anyone tell me more about this error and how to resolve or at least investigate about it?
Varnish performs a health check on your backends which might need to be configured more precisely for Apache to accept it. If this doesn’t solve your problem, try logging the User-Agent header in Apache to find out who is make the malformed request.