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

Solution Unverified - Updated -


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


  • 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, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content