Forum Discussion
PUTMANO_KEO
Sep 22, 2020Nimbostratus
Need Help for iRule To Block Specific URL
We have our website abc.com and we would like to block the specific like abc.com/123/ which access from Japan. I try to find some trick to write the iRule but it's not access. Anybody here can me on ...
Samir
Dec 03, 2020MVP
Try below iRule. Hope it will work for you.. thanks
when HTTP_REQUEST {
set fromCountry [whereis [IP::client_addr] country]
if { ([class match $fromCountry equals example_datagroup]) && ([HTTP::uri]] starts_with "/abc") } {
log local0. "Attacker IP in XFF [HTTP::header X-Forwarded-For]" ;# This can be removed/commented out if not required
HTTP::respond 403 content "Blocked!" ;# This can also be changed to drop or reject based on the requirement
}
}
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects