Forum Discussion
ucgwebmaster_95
Nimbostratus
Jun 11, 2008URL redirect to different pool
I have an urgent need and I am not sure how to do this. I have a pool of 2 nodes which use host headers on the same IP in IIS. I need to take one of the DNS names and redirect traffic to a different node in a different pool.
e.x. www.abc.com would redirect to pool 2 all other request would redirect to pool 1.
This would also need to work for all uri's.
Any help would be greatly appreciated.
Thank you,
F5 Newbie in need
7 Replies
- ucgwebmaster_95
Nimbostratus
I just thought about it and I put in miss information.
I would really like to add a 3rd member to the pool the VS is using. I need the rule to send client requests to this node based on the http://www.something.com and http://www.something.com/* - Ian_SmithRet. Employeehere is the host header irule, fwiw:
when HTTP_REQUEST {
switch [HTTP::host] {
www.site1.com {
pool pool_site1
persist cookie
}
www.site2.com {
pool pool_site2
persist cookie
}
www.site3.com {
pool pool_site3
persist cookie
}
default { reject }
}
} - ucgwebmaster_95
Nimbostratus
I will try this out, but what is the default reject going to do? - Colin_Walker_12Historic F5 AccountThe default reject statement will say that if the switch cases aren't matched, it will reject the incoming request. If that's not what you're looking for, you can modify the action there, or remove the default clause all-together.
Colin - ucgwebmaster_95
Nimbostratus
So just to be clear:
I have a Virtual Server which resolves to several DNS names (www.abc.com, www.def.com, www.ghi.com). I have a pool of 2 nodes which currently the Load Balanced traffic is directed to. I want to take www.abc.com and send it to a different pool with a different node. All other requests should remain going to the default pool of the VS.
If I use the default reject, does that mean anything outside of the hosts defined are using the default pool?
VS. 192.168.80.100
Pool1 - 172.16.80.1 and 172.16.80.2(Default Pool for 192.168.80.x)
DNS (192.168.80.x) - www.abc.com, www.def.com, www.ghi.com etc)
Pool2 - 172.16.80.3 - Only traffic with the host www.abc.com or www.def.com should go here. All other traffic should go to Pool1 - Colin_Walker_12Historic F5 AccountYou don't need the reject statement. What that switch statement is saying is:
If I the HTTP Host address is "www.site2.com", send to pool pool_site2 and use the cookie persist profile.
If the HTTP Host address is "www.site3.com", send to pool pool_site2 and use the cookie persist profile.
If the HTTP Host address is neither of the above, reject the connection.
It sounds like you can remove the default section all together, and still have the functionality you want.
Colin - zax_44243
Nimbostratus
Please forgive me, I am brand new to this....
Do these rules assume that the url is formed exactly like the case? Example
www.myurl.mycompany.com is the same as myurl.mycompany.com as is myurl when referring to an internal name for an application.
is there a "like" argument that can include just myurl which should be inclusive of all 3 instances I listed above?
My problem is similar to the one above, however I am trying to switch on multiple levels.
Example:
myurl\servicegroup1\webservice1 - forward to pool 1
myurl\servicegroup1\webservice2 forward to pool 2
myurl\servicegroup2\webservice1 - forward to pool3
myurl\servicegroup2\webservice1 - forward to pool3
I have a complex group of webservices, some which need to be load balanced by "servicegroup" and others which need to be load balanced by the actual service. My current application includes 30 VIPS to accomplish these needs. I am attempting to use the LTM to consolidate these down to one VIP with an iRule which will send traffic to the appropriate pool. The example above is a good start, however my environment is slightly more complex and I need more information.
Any direction you can provide me is appreciated!
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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