I went through a lot of posts related to this issue but I could not find a proper answer. Here is my problem:
I'm trying to enable request logging in Tomcat using AccessLogValve & RemoteIpValve in order to get the IP addresses that originated the request and not the IP from the Loadbalancer.
I have set my Tomacat as follows:
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="access_log." suffix=".txt"
pattern="%h %l %u %t "%r" %s %b %D"
resolveHosts="false"/>
<Valve className="org.apache.catalina.valves.RemoteIpValve"
internalProxies="127\.0\.0\.1| +IP adress from the loadbalancer"
trustedProxies="127\.0\.0\.1| +IP adress from the loadbalancer"
remoteIpHeader="x-forwarded-for"
remoteIpProxiesHeader="x-forwarded-by"
protocolHeader="x-forwarded-proto"/>
As I am using Apache to proxy requests to Tomcat, I added the following to my httpd-vhosts.conf
<VirtualHost *:80>
...
RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} !http
RewriteRule !/status http://%{SERVER_NAME}%{REQUEST_URI} [L,R]
But still my logfiles display only the IP from my Loadbalancer.
So I guess I'missing something here and would deeply appreciate a little help. Thanks a bunch