Project

General

Profile

[Solved] Can't get your $HTTP["host"] working and running multitail? Check this out

Added by peterg22 over 11 years ago

Dear all.. just a heads-up if you're struggling to get $HTTP["host"] recognising the hostname, and like me, you're running the excellent multitail to keep an eye on several logs at once.

I found that however hard I tried, lighty apparently wouldn't recognise this:

$HTTP["host"] =~ "mydomain.com" { status.status-url = "/server-status" }

But when I looked in the lighty logs manually, all I could see was the IP address.. very odd. Initially I couldn't figure where the hostname lookup was taking place, and then I looked in /etc/multitail.conf, where I noticed:

resolv_ip_addresses=yes

I've now changed this and all works properly. Just thought you may find this useful!


Replies (1)

RE: Can't get your $HTTP["host"] working and running multitail? Check this out - Added by gstrauss about 2 years ago

@peterg22 I don't think things are working the way that you think that they are working.

If a client does not send "Host" header with HTTP/1.0 request, then the $HTTP["host"] config condition does not have anything against which to match. (HTTP/1.1 requires "Host" header, and HTTP/2 requires ":authority" pseudo-header)

When the "Host" header (or HTTP/2 ":authority") is present, then $HTTP["host"] config condition matches against that header from the request.

    (1-1/1)