Apache access log host header does not match host in original request

Solution Unverified - Updated -

Issue

  • Using %{Host}i % in the access log format to log the host header:
LogFormat "%{Host}i %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" custom
  • Requests with two different Host headers is made:
curl -H 'Host: aaa.example.com' "http://1.2.3.4/"
curl -H 'Host: bbb.example.com' "http://1.2.3.4/"
  • Onely one host (aaa.example.com) logged in the access log, despite different Hosts in the requests:
aaa.example.com ::1 - - [04/Nov/2015:14:08:05 -0500] "GET / HTTP/1.1" 403 3985 "-" "curl/7.29.0"
aaa.example.com ::1 - - [04/Nov/2015:14:09:11 -0500] "GET / HTTP/1.1" 403 3985 "-" "curl/7.29.0"

Environment

  • Red Hat Enterprise Linux
  • Apache httpd

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.