Couldn't output X_FORWARDED_FOR request header by LogFormat directive when RemoteIPHeader directive set it

Solution Unverified - Updated -

Issue

We tried to record an original source IP address with a following LogFormat, but it didn’t work when it is configured in conjunction with RemoteIPHeader directive. It only outputs "-" for X-Forwarded-For column.

RemoteIPHeader X-Forwarded-For
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %{X-Forwarded-For}i %D" combined

Environment

  • Red Hat Enterprise Linux (RHEL)
  • JBoss Core Services (JBCS)
  • Apache httpd
    • 2.4.x

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