Forum Discussion
green_frog_2046
Nimbostratus
Jul 08, 2016irules blocking url
Im new to irule
I need to have access requests to e.g. f5.com URL ending in /audio.mp3 blocked by the F5.
Ive asked mr google and found this link https://devcentral.f5.com/questions/how-to...
RossVermette
Nimbostratus
Jul 11, 2016Here is a quick example of irule that will match for HTTP host header of (f5.com or www.f5.com) and then look for multiple files (ex audio.mp3, audio1.mp3 etc.)
Code
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::host]] {
"f5.com" -
"www.f5.com" {
switch -glob [string tolower [HTTP::path]] {
"*/audio.mp3" -
"*/audio1.mp3" -
"*/audio2.mp3" {
HTTP::respond 403 content "ACCESS Denided" Connection Close
}
}
}
}
} Tools that I use: I currently use the F5 iRule editor to help with creating rules. I'm currently looking at eclipse with the f5 plugin, just haven't tried it out yet.
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