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
Apr 11, 2014Noctilucent
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_1Apr 11, 2014NimbostratusI'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.
- Cory_50405Apr 11, 2014NoctilucentBy inconsistent results, do you mean some clients are getting directed to the incorrect node? Have you been able to determine whether all clients are having this issue or just certain ones?
- Eric_Hartwell_1Apr 11, 2014Nimbostratusjust certain ones. I've only added 4 at this point. two work. two dont. the two that dont are identical format in the data group but when hitting them, I get redirected to a apache test page instead of the proper screen. Is there a way to see what node is being chosen and connected to? perhaps to a log file specific to this?
- Cory_50405Apr 11, 2014NoctilucentFor the two nodes that aren't working that are issuing redirects, what are they trying to redirect to? You can certainly add a line in the iRule to log the client IP address, the requested host, and which node was selected.
- Eric_Hartwell_1Apr 11, 2014NimbostratusThey are directing to a random pool member. These need to be directed to a specific pool member as they all have different customer data on them.
- Cory_50405Apr 11, 2014NoctilucentI think I was misunderstanding you. For the two flows that aren't working, I thought you were saying those two nodes were issuing HTTP redirects elsewhere. You're saying the LTM is actually sending traffic for these two flows to the incorrect node (not the one you specified in the data group), and no HTTP redirect is occurring from the node? Can you browse directly to the problematic node IP addresses, and do page loads work if so? Or can you use curl to retrieve content from those nodes?
- Cory_50405Apr 17, 2014NoctilucentEric, what did the issue turn out to be?
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