Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have Apache with mod_proxy passing requests to Tomcat. The trouble is, when I get client IP address associated with a request in web app hosted on Tomcat, it always returns

Is it possible to have Apache pass the original IP address to Tomcat?

share|improve this question
up vote 4 down vote accepted

The X-Forwarded-For environment variable should also be set by default with mod_proxy

share|improve this answer

I'd recommend using mod_jk or mod_proxy_ajp if you're wanting to retain information about the original requests source ip address.

share|improve this answer

Your configuration should include ProxyPreserveHost On, similar to

<VirtualHost *:80>

  ProxyRequests Off
  ProxyPreserveHost On

  <Proxy *>
    Order deny,allow
    Allow from all

  ProxyPass / http://localhost:8180/
  ProxyPassReverse / http://localhost:8180/

See my stackoverflow answer for more details.

share|improve this answer
It did not seem to work with what I needed it for. In the end I decided to go for the X- header. Thank you! – Konrad Garus Apr 12 '10 at 8:36
This answer refers to keeping the "" on the outgoing request to http://localhost:8180/ not making the client ip valid. – Martin Aug 13 '14 at 15:28

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.