Forum Discussion
youe_100642
Nimbostratus
Nov 30, 2011Host header based web farm iRule & Class
We run multiple name based clusters of web servers (some with thousands of name based virtual hosts). For various reasons, we need to be able to divide the web server configuration of these clusters ...
youe_100642
Nimbostratus
Apr 05, 2013I updated the rule to not error if the class did not exist:
rule RULE_POOLMAPPING_V01 {
when RULE_INIT {
set static::CLASS "CLASS_POOLMAPPING_V01"
set static::DEBUG 0
set static::HTTPS_PORT 443
}
when HTTP_REQUEST {
if { [class exists $static::CLASS] } {
set zone_pool [class match -element -- [string tolower [HTTP::host]] equals $static::CLASS]
}
if { [info exists zone_pool] && [llength $zone_pool] == 2 } {
set pool [lindex $zone_pool 1]
if { [TCP::local_port clientside] equals $static::HTTPS_PORT } {
append pool "S"
}
if { $static::DEBUG } {
log local0. "WEBCLUSTER DEBUG: [HTTP::host]->$pool"
}
if { [catch { pool $pool }] } {
log local0. "WEBCLUSTER ERROR: Non-existant pool: $pool"
}
} elseif { $static::DEBUG } {
log local0. "WEBCLUSTER DEBUG: No match for host: [HTTP::host]"
}
}
}
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