Forum Discussion
Greg_76561
Nimbostratus
Jan 28, 2011Route to different pools based on /content
Hello,
I'm new to iRules and trying to come up with a way to send traffic to different pools based on the /content in the url.
I have a secure site which the ssl certificate is ins...
hoolio
Cirrostratus
Jan 28, 2011Hi Greg,
You can use HTTP classes or an iRule to do this. With HTTP classes, (in the GUI under Profiles : Protocol : HTTP Class) you'd create one class per pool and configure the URI's with string matching in the URI Paths section. Here is a view of the config from the bigip.conf:
profile httpclass qa_class {
defaults from httpclass
pool qa_pool
redirect none
paths {
"/QA*"
"/qa*"
}
}
profile httpclass uat_class {
defaults from httpclass
pool uat_pool
redirect none
paths {
"/UAT*"
"/uat*"
}
}
Note that I'm assuming the app isn't case sensitive and you'd want /UAT and /uat to both go to the same pool. You could add a final HTTP class with no filters and specify a pool for all URIs which don't match a prior HTTP class.
Here is an example of an iRule to select between pools based on the URI:
when HTTP_REQUEST {
Check URI set to lower case with wildcard matching
switch [string tolower [HTTP::uri]] {
"uat*" {
uat_pool
}
"qa*" {
qa_pool
}
default_pool {
qeneral_pool
}
}
}
Aaron
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
