Forum Discussion
Albert_252822
Aug 22, 2016Nimbostratus
ASM iRule events not working
Hi all,
I activated this irule in my Virtual Server:
when HTTP_REQUEST {
set redirect 0
set requri [HTTP::uri]
}
when ASM_REQUEST_BLOCKING {
set redirect 1
}
when HTTP_RESPONSE {...
Hannes_Rapp
Nimbostratus
Have not tested, but in theory, this should do what you want:
when ASM_REQUEST_DONE {
if { [ASM::status] equals "blocked" } {
switch -glob [string tolower [HTTP::path]] {
"/url1*" {
ASM::unblock
HTTP::respond 302 Location "https://url1/index" Connection Close
}
"/url2*" {
ASM::unblock
HTTP::respond 302 Location "https://url2/index" Connection Close
}
"/url3*" {
ASM::unblock
HTTP::respond 302 Location "https://url3/index" Connection Close
}
default { }
}
}
}
Albert_252822
Aug 23, 2016Nimbostratus
My original irule is not showing any errors on logs. Although is not working properly, there aren't syntax errors:
info: ASM blocking
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