Forum Discussion
Dmitry_Sherman
Nimbostratus
Sep 12, 201311.4 node/pool select according to domains list
Hello,
I need to perform node/pool selection according to big domains list.
I have a list of 500 domains that have to be routed to a specific node, all other domains should be routed to the second no...
Kevin_Stewart
Employee
Sep 12, 2013As 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
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