Forum Discussion
Carl_Gottlieb_1
Nimbostratus
Apr 24, 2007irule priority with asm - version 9.2.4
On version 9.2.4 I had a virtual server, pool attached along with an irule as below, to redirect balnk uri's:
when HTTP_REQUEST {
if { [string length [HTTP::uri]] <= 1 } {
HTTP::redirect "https://www.domain.com/home"
}
}
This works fine. If I remove the default pool, and add an ASM class containing the pool to the policy, ASM works but the irule doesn't trigger.
Is there any way I can get the above rule to happen first?
Many thanks
Carl
2 Replies
- hoolio
Cirrostratus
SOL7041 has an example of how to handle scenarios in iRules where you want to prevent the request from going to ASM.
https://tech.f5.com/home/solutions/sol7041.htmlClick herewhen HTTP_REQUEST { set asm_bypass 0 if { [HTTP::uri] starts_with "/mydir" } { HTTP::redirect "http://www.mysite.com/myredirect" set asm_bypass 1 } }
You could also tweak your rule slightly, as a URI will never be 0 length. If it's 1 character, it must be "/".when HTTP_REQUEST { by default, don't bypass ASM set asm_bypass 0 if { [HTTP::uri] eq "/" } { request was for / so send a redirect and disable ASM for this request HTTP::redirect "http://www.domain.com/home" set asm_bypass 1 } }
Aaron - Carl_Gottlieb_1
Nimbostratus
Thanks Aaron.
This worked perfectly.
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
