Forum Discussion
eliton_199802
Nimbostratus
May 24, 2017Directory blocking iRule with exceptions
I'm looking to implement that does the following
If users attempt to access
/directory1
/directory2
/directory3
They are blocked/logged, however they are allowed a specific file under ...
JG
Cumulonimbus
May 24, 2017Try this one:
when HTTP_REQUEST {
switch -glob -- [string tolower [HTTP::path]] {
"/directory1/file1" {
}
/"directory1*" {
log local0. "[IP::client_addr] trying [HTTP::path]: blocked."
reject
}
/"directory2/file27" {
}
"/directory2*" {
log local0. "[IP::client_addr] trying [HTTP::path]: blocked."
reject
}
default {
}
}
}
.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
