Forum Discussion
rdessert_76127
Jul 27, 2012Nimbostratus
Load balancing to a domain name vs a pool
My organization has a website that has some of its content local and some located at a cloud provider. I have an existing irule which forwards traffic to different pools based upon the URI's. I have a pool defined for our cloud provider containing a public IP address for a load balancer VIP.
My organization decided to change cloud providers and the new provider demands the use of a domain name vs an IP address for their resources, therefore I can no longer use a pool because pool members can only be an IP address.
I've found some stuff on devcentral regarding the NAME::lookup and RESOLV::lookup commands which leads me to believe this is the route I'll need to go down.
Does anyone have any reccomendations?
My existing irule is:
when HTTP_REQUEST {
if { [HTTP::host] equals "site.com" } {
HTTP::respond 301 Location "http://www.site.com[HTTP::uri]"
} else {
log local0.alert "BEGIN Host:[HTTP::host]-[HTTP::uri]-[HTTP::path]"
switch -glob [string tolower [HTTP::uri]] {
"/" -
"/*" -
"/foo/*" -
"/bar/*"
{
log local0.alert "cloud_pool Host:[HTTP::host]-[HTTP::uri]"
pool cloud_pool
return
}
default {
pool def_pool
}
}
}
Thanks for any help / feedback!
Rich
- rdessert_76127NimbostratusAlso, I'm thinking I'll have to specify a port somehow to go along with the resolved IP address. All traffic is http...
- Brian_Van_StoneNimbostratusThe only way the cloud server has any idea whether or not you used a host name to connect is by the value of the host header. You should be able to just replace the value of the host header before forwarding the request on to the pool representing the cloud server's IP. The change might not be reflected in the log entry because I think header information is parsed once and then [HTTP::host] will always return what was parsed before iRule execution, but that's a question for the gurus.
- rdessert_76127NimbostratusThanks Brian, I appreciate the response...
- Michael_YatesNimbostratusHi rdessert,
- rdessert_76127NimbostratusThanks Michael. I'm going to try to get RESOLV::lookup working for me.
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