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 the directory, such as
/directory1/file1 /directory2/file27
Everything else in those directories besides the files specifies above are blocked/logged
- JG
Cumulonimbus
Try 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 { } } }
.
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