Hello all,

I currently have a problem with Tomcat7, or rather a colleague has it.
Personally I would like to help him, but I can't find the error myself.
We already asked the question on stackoverflow.com and got a good hint,
but unfortunately no solving. So I would like to ask for help and
support here. I think I am violating the directive of asking a double
question, but it is important to me personally to help this colleague.
Therefore I am at least honest, the question can also be found at the
link: 
https://stackoverflow.com/questions/60827540/tomcat-x-forwarded-for-doesnt-work-with-load-balancer

We run a software that uses Tomcat as application server behind a load
balancer. Now we would like to record the initial address of the
requests and not the IP of the load balancer. We have used these 3
websites for the setup, but unfortunately it does not work. The IPs of
the loadbalancers are still written to the access log. 
https://tomcat.apache.org/tomcat-7.0-doc/api/org/apache/catalina/valves/RemoteIpValve.html
https://tomcat.apache.org/tomcat-7.0-doc/api/org/apache/catalina/valves/AccessLogValve.html
https://tomcat.apache.org/tomcat-7.0-doc/config/valve.html#Remote_IP_Valve

We used the following configuration for access logging and remote
valve:
<Valve className="org.apache.catalina.valves.RemoteIpValve"
internalProxies="xxx\.xxx\.xxx\.7|xxx\.xxx\.xxx\.8|xxx\.xxx\.xxx\.9"  r
emoteIpHeader="X-Forwarded-For" />
<Valve className="org.apache.catalina.valves.AccessLogValve"
directory="logs"
prefix="access_log." suffix=".log"
pattern="%{org.apache.catalina.AccessLog.RemoteAddr}r %l %u %t
&quot;%r&quot; %s %b" 
requestAttributesEnabled="true" />

The request header 'X-Forwarded-For'
was set and load balancer was analyzed via wireshark and Request Dumper
Filter. We can see the header in both. However we still only get the IP
of the load balancer and not the IP of the remote client. The IP
adresses of the config have already been checked and they are correct.

Thank you very much in advance for your support.

With kindest regards
Frank


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to