Forum Discussion
11.4 node/pool select according to domains list
As an iRule, this sounds like an excellent candidate for a data group.
Step 1: create a string-based data group consisting of domain names and corresponding nodes. Example (my_domain_dg):
"www.domain1.com" := "10.10.10.11 80"
"www.domain2.com" := "10.10.10.12 80"
"www.domain3.com" := "10.10.10.13 80"
"www.domain4.com" := "10.10.10.14 80"
...
"www.domain500.com" := "10.10.10.510 80"
And a reasonably simple iRule:
when HTTP_REQUEST {
if { [class match [string tolower [HTTP::host]] equals my_domain_dg] } {
set my_node [split [class match -value [string tolower [HTTP::host]] equals my_domain_dg]]
node [lindex $my_node 0] [lindex $my_node 1]
}
}
You can also use this method with pools, which may be a better option in the future if you're going to need to actually load balance and scale out services. The beauty of this approach is that you manage a single data group and don't really have to touch the iRule.
...And you can also do this with policies in 11.4
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