Forum Discussion
Which runs first iRULE or PolicyLTM(With ASM being applied)
In your specific setup:
- The LTM policy LTM_POLICY_ASM_MYSITE is evaluated first.
- If the http-host matches www.mysiteexample.com.br or mysiteexample.com.br, the ASM policy /Common/ASM_MYSITEWAFPOLICY is enabled.
- If the http-uri contains miscelaneous, the ASM policy /Common/ASM_MYSITEWAFPOLICY_MISC is enabled.
- If neither of these conditions are met, the no_asm rule disables ASM processing.
- After the LTM policy conditions are evaluated and any ASM policies are enabled or disabled, the HTTP_REQUEST iRule is processed.
- The traffic is then inspected by the ASM policy if it has been enabled by the LTM policy.
If the ASM policy is interfering with the iRule, you might need to structure your LTM policy and iRule to ensure the iRule logic executes as expected. One approach could be to temporarily disable the ASM policy within the iRule for specific conditions and then re-enable it after the redirect, though this can be complex and might not always be feasible.
when HTTP_REQUEST {
if {[HTTP::uri] starts_with "/region1/abc"} {
# Temporarily disable ASM for this specific redirect
ASM::disable
HTTP::redirect https://[getfield [HTTP::host] ":" 1][HTTP::uri]
ASM::enable
} elseif {[HTTP::uri] starts_with "/region2/abc"} {
ASM::disable
HTTP::redirect https://[getfield [HTTP::host] ":" 1][HTTP::uri]
ASM::enable
} elseif {[HTTP::uri] starts_with "/region3/abc"} {
ASM::disable
HTTP::redirect https://[getfield [HTTP::host] ":" 1][HTTP::uri]
ASM::enable
} elseif {[HTTP::uri] starts_with "/region4/abc"} {
ASM::disable
HTTP::redirect https://[getfield [HTTP::host] ":" 1][HTTP::uri]
ASM::enable
} else {
# do nothing
}
}
Recent Discussions
Related Content
* 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