You can take the source code for RemoteIPFilter and have it look at the 
X-Forwarded-For header.

Even better offer a patch to RemoteIPFilter to allow the header field name to 
be configured. 

You are not the only one with this use case.

Regards,
Dave

Sent from my iPhone

> On Feb 15, 2016, at 7:07 AM, André Warnier (tomcat) <a...@ice-sa.com> wrote:
> 
>> On 15.02.2016 13:03, Dhanushka Parakrama wrote:
>> 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 .
> 
> Maybe have a look at : http://tuckey.org/urlrewrite/ ?
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 

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

Reply via email to