Getting Tomcat to use the X-Forwarded-For header

Brian Moon bmoon at
Fri Jul 3 03:44:04 UTC 2020

Hello Keith,

We are in the midst of migrating to GCP ourselves, so I had to deal with
this just last week.  Below is how we've configured the RemoteIpValve:

<Valve className="org.apache.catalina.valves.RemoteIpValve"

       protocolHeader="X-Forwarded-Proto" />

All of the internal proxies listed there are GCP specific, so you will need
to update that list with the internal proxies for the AWS ALB..

More information about configuring that valve can be found here:


Brian Moon
Senior System Administrator, Enterprise Systems
Santa Clara University

On Thu, Jul 2, 2020 at 7:27 PM Wessel, Keith <kwessel at> wrote:

> All,
> I've been operating our IdP behind load balancers that are kind enough to
> pass through the client's IP address as the source address instead of in
> the X-Forwarded-For header. As we begin a move to AWS with the Trusted
> Access Platform containers and an Amazon ALB, I now need to take an extra
> step to get Tomcat to use the X-Forwarded-For IP instead of the client IP
> (which is that of the ALB instead of the originating client). This is
> partly for logging of client IPs, but also for the access control facility.
> I've tried adding this to the <host> block of Tomcat's server.xml with no
> change in behavior:
>         <Valve className="org.apache.catalina.valves.RemoteIpValve" />
> The IP that appears in the IdP logs is still that of the ALB.
> Has anyone on this list found a way to get the originating client's IP
> instead of that of the load balancer inside the IdP when running Tomcat?
> Thanks,
> Keith
> --
> For Consortium Member technical support, see
> To unsubscribe from this list send an email to
> users-unsubscribe at
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the users mailing list