Client sent invalid Host header

I keep getting this error in the Apache error log:

[client 127.0.0.1] Client sent malformed Host header 

exactly every 5 minutes. This has been happening since we installed Varnish on our server, but I can’t understand why and how to fix it. I even tried setting Apache error_log for debugging, but no other useful information is provided. Any idea?

The configuration of our varnish is very simple:

 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 virtual hosts that run on port 9001.

Can someone tell me more about this error and how to resolve, or at least investigate it?

+4
source share
1 answer

Varnish performs a health check on your servers, which you may need to configure for Apache to accept. If this does not solve your problem, try registering the User-Agent header in Apache to see who is making the wrong request.

+2
source

Source: https://habr.com/ru/post/1442701/


All Articles