Hi Guys

I have a Tomcat instance behind the load balancer (LB) , LB will pass the
client ip address to backed tomcat instance using *X-forward-for*  header .

I basically want to filter user traffic based on the *X-forwaed-for* header
in tomcat instance

i have configured the following filter in tomcat , but it not working


<filter>
    <filter-name>Remote Address Filter</filter-name>
    <filter-class>org.apache.catalina.filters.RemoteIpFilter</filter-class>
        <init-param>
            <param-name>allow</param-name>

<param-value>localhost|205\.97\.96\.\d+|::1|0:0:0:0:0:0:0:1</param-value>
        </init-param>
</filter>

<filter-mapping>
    <filter-name>Remote Address Filter</filter-name>
    <url-pattern>/mgt/*</url-pattern>
</filter-mapping>


Do you guys have any advice how to achieve it .

Thank You
Dhanushka

Reply via email to