How can I log the original clients address from the X-Forwarded-For header?

Solution Verified - Updated -


  • I have a proxy or NAT in front of Apache httpd, Tomcat or JBoss. I want access logs to capture the original client ip, which is available in the X-Forwarded-For header, instead of the proxy or NAT'd address.


  • JBoss Enterprise Application Platform (EAP)
    • 5.x
    • 6.x
    • 7.x
  • JBoss Enterprise Web Server (EWS)
    • 2.x
    • 3.x
  • Tomcat
  • Apache httpd

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