Source peer IP address is no longer printed in access log %{X-Forwarded-For}i format after updating JBCS Apache from 2.4.6 to 2.4.37

Solution Verified - Updated -

Issue

Why does format %{X-Forwarded-For}i no longer print the IP address of the source peer after updating JBCS Apache from 2.4.6 to 2.4.37?

Our httpd.conf has the below LogFormat directive, %{X-Forwarded-For}i behavior appears to have changed between 2.4.6 and 2.4.37.

LogFormat "%h %{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
ProxyPass "/" http://127.0.0.1:8080/

If we send the following request by curl:

$ curl -H 'X-Forwarded-For: 192.168.1.10' http://192.168.1.2/echo/echo

JBCS Apache 2.4.6 or earlier, %{X-Forwarded-For}i print the value of X-Forwarded-For and source peer IP address:

192.168.1.1 192.168.1.10, 192.168.1.1 - - [01/Feb/2023:13:26:12 +0900] "GET /echo/echo HTTP/1.1" 302 - "-" "curl/7.61.1"

In JBCS Apache 2.34.37, %{X-Forwarded-For}i only print the value of X-Forwarded-For request header:

192.168.1.1 192.168.1.10 - - [01/Feb/2023:13:26:12 +0900] "GET /echo/echo HTTP/1.1" 302 - "-" "curl/7.61.1"

Environment

  • Red Hat JBoss Core Services Apache HTTP Server (JBCS Apache)
    • 2.4.z
    • mod_proxy

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