Forum Discussion
Chris_Day_10331
Nimbostratus
Dec 27, 2005iRules for Individual Testing of Farm Servers
Hello wonderful people at DevCentral!
I have a follow-up to an earlier post I had made “iRule for Server Testing” (http://devcentral.f5.com/default.aspx/Default.aspx?tabid=28&forumid=5&posti...
Chris_Day_10331
Nimbostratus
Dec 28, 2005Hey, this looks great but how does it deal with the re-writing of the host headers. Previously, I had a chunk that looked something like this:
when HTTP_REQUEST {
Search for host mapping in the lookup list
set new_host [findclass [HTTP::host] $::HostMap_External " "]
if { "" ne $new_host } {
if mapping is found, replace the Host header
log local0. "Replacing host from [HTTP::host] to $new_host"
HTTP::header replace "Host" $new_host
Pull out the node name as the first element of the uri
ie. /web001/foo/bar -> web001
set node_name [lindex [split [HTTP::uri] "/"] 1]
if { "" ne $node_name } {
Now look for the node address in the lookup list
log local0. "Searching for node: $node_name"
set node_addr [findclass $node_name $::NodeMap_External " "]
if { "" ne $node_addr } {
log local0. "Routing to node: $node_addr "
node $node_addr
} else {
log local0. "Didn't find node '$node_name' in lookup class"
}
} else {
log local0. "No node name passed in URI"
}
} else {
log local0. "Didn't find [HTTP::host] in lookup class"
}
}It looks to me like your example will help with the FQDN/IP/ example but not the FQDN.TEST/IP/ or FQDN.TEST/NAME/. I appreciate anything you can do - and let me know if there is anything I can get for you as a late xmas gift!
CD
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