Forum Discussion
Eric_Hartwell_1
Apr 11, 2014Nimbostratus
irule for selecting a node based on a url
We are doing some web hosting where customers come in on customer1.com, customer2.com, etc. We CNAME them to shared.hosting.com which has a corresponding wideIP.
Can we have an irule that selects whi...
- Apr 11, 2014
The iRule and solution Kevin provided in that link looks to be exactly what you need. And yes, you can reference more than one URL in the data group to point to the same node.
Cory_50405
Noctilucent
The iRule and solution Kevin provided in that link looks to be exactly what you need. And yes, you can reference more than one URL in the data group to point to the same node.
Eric_Hartwell_1
Apr 11, 2014Nimbostratus
I'm testing the solution and getting inconsistent results. Some URLs direct properly and others dont. I want customer1.com to be directed to node 10.10.15.1, customer2.com to be redirected to 10.15.15.1 and so on. each customer URL goes to its own node. The data group seems to work, but as I said, it's inconsistent.
My data group looks like
customer1.com := 10.10.15.1 80
customer2.com := 10.15.15.1 80
customer3.com := 10.15.16.1 80
My irule in place is
when HTTP_REQUEST {
if { [class match [string tolower [HTTP::host]] contains Shared_DataGroup] } {
set my_node [split [class match -value [string tolower [HTTP::host]] contains Shared_DataGroup]]
node [lindex $my_node 0] [lindex $my_node 1]
}
}
suggestions are welcome.
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