Forum Discussion
11.4 node/pool select according to domains list
Yes you can. The first match goes to pool1, the second match (without a condition) goes to pool 2. pseudocode is below (adapt to correct irule syntax):
if (match) {
go to pool 1
}else {
go to pool 2
}
Note that the value of the string is irrelevant, depending on how you structure the class match in your irule. For instance, the values of the strings are irrelevant if you use "class exists" in stead of "class match". Class exists simply checks if the element exists in the class, so if your data group is a list of "domain" := "an IP address", then class exists is convenient as it ignores the IP address set in the datagroup, and simply checks if this domain is in the list:
if {class exists HTTP::host} {
pool pool1
}else {
pool pool2
}
You need a datagroup of type String. And the datagroup example Kevin gave should work for this. You have to as usual, be careful of the hostnames you specify, especially if your site is both accessible as "www.domain.com" and just "domain.com". You either need to set things up so that clients always get redirected to one kind, or you include both kinds of hostnames in the datagroup.
Reference: class command: https://devcentral.f5.com/wiki/irules.class.ashx
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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