Forum Discussion
New to iRule and need it for this scenario
Hi guys, i need some help regarding the iRule so here's the scenario.
I have a VS named MY_VS
in this VS there are 2 iRules.
iRule1 is at the top and iRule2 is at the bottom.
iRule 1 is to Block HTTP OPTIONS method.
when HTTP_REQUEST {
if { ( [HTTP::method] equals "OPTIONS" ) } {
TCP::close
}
}
iRule 2 is to redirect request to specific pool based from URI
when HTTP_REQUEST {
if { [string tolower [HTTP::uri]] starts_with "/PAGE1" } {
pool MY_POOL_1
persist cookie insert PAGE1-COOKIE 0
} elseif { [string tolower [HTTP::uri]] starts_with "/PAGE2" } {
pool MY_POOL_2
persist cookie insert PAGE2-COOKIE 0
} elseif { [string tolower [HTTP::uri]] starts_with "/PAGE3" } {
pool MY_POOL_3
persist cookie insert PAGE3-COOKIE 0
} else {
pool MY_DEFAULT_POOL
}
}
Now The issue:
There is a request that requires HTTP OPTIONS to be forwarded/allowed to PAGE3 URI only.
for All other URI, HTTP OPTIONS must still be blocked.
Thanks for the answers.
- spalande
Nacreous
when HTTP_REQUEST { if { ([HTTP::method] equals "OPTIONS") and ( not [string tolower [HTTP::uri]] starts_with "/page3") } { reject } }
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