Forum Discussion
Mayank_Shukla
Altostratus
Mar 09, 2015Please help in creating a content switching irule
Below is the requirement:-
If url https://xyz.abc.com contains below switches ; it should point to pool1:-
/providerportal1/* - proxy to pool1
/Resources/* - proxy to pool1
/provider...
Eric_St__John
Employee
Mar 10, 2015I would make a couple of minor changes for efficiency(HTTP::path rather than HTTP::uri), and to deal with the possibility of upper/lower case requests(string tolower):
when HTTP_REQUEST {
if {[string tolower[HTTP::host]] == "xyz.abc.com"} {
switch -glob [string tolower[HTTP::path]] {
"/providerportal1/*" -
"/resources/*" -
"/provider_get/*" -
"/exadmin/*" {
pool pool1
}
"/portal/*" {
pool pool2
}
}
}
}
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