java - block IP using tuckey-urlrewrite-filter rermote-addr -
i trying block ip parts of application using urlrewritefilter 4.0.3. can not work no matter try. can please help?
i have added urlrewritefilter-4.0.3.jar - /var/lib/tomcat7/webapps/myapp/web-inf/lib have added urlrewrite.xml in /var/lib/tomcat7/webapps/myapp/web-inf/.
i have added following lines web.xml in /var/lib/tomcat/webapps/myapp/web-inf/ :
<filter> <filter-name>urlrewritefilter</filter-name> <filter-class>org.tuckey.web.filters.urlrewrite.urlrewritefilter</filter-class> <init-param> <param-name>confreloadcheckinterval</param-name> <param-value>0</param-value> </init-param> <init-param> <param-name>statusenabled</param-name> <param-value>true</param-value> </init-param> <init-param> <param-name>loglevel</param-name> <param-value>debug</param-value> </init-param> <init-param> <param-name>statusenabledonhosts</param-name> <param-value>localhost</param-value> </init-param> </filter> <filter-mapping> <filter-name>urlrewritefilter</filter-name> <url-pattern>/*</url-pattern> <dispatcher>request</dispatcher> <dispatcher>forward</dispatcher> </filter-mapping>
in have written following condition , placed in urlrewrite.xml
<rule> <condition type="remote-addr">^123\.123\.42\.36$</condition> <from>/myapp/login*</from> <set type="status">403</set> <to>null</to> </rule>
i thought doing block ip accessing /myapp/login part of application doesn't work.
any suggestions how round appreciate want block individual ip ranges sections of application.
thanks ollie
Comments
Post a Comment