Forum Discussion
stolivar_88319
Nimbostratus
Mar 28, 2012Using iRule for host header and uri routing (problem)
I have a virtual Server(F5) set up on an IP. I have two websites that share this IP and IIS is configured to handled host header hosting. I also run some java tomcat apps on one of the domains hoste...
hoolio
Cirrostratus
Mar 28, 2012Hi Stolivar,
Can you try this version of the iRule which explicitly selects a pool for all cases? Once you're done testing, you can disable or remove the debug logging.
when CLIENT_ACCEPTED {
Log debug to /var/log/ltm? 1=yes, 0=no.
set switch_debug 1
Save the name of the VS default pool before the iRule could change it
set default_pool [LB::server pool]
}
when HTTP_REQUEST {
switch [string tolower [HTTP::host]] {
www.host2.com {
pool host2
if {$switch_debug}{log local0. "[IP::client_addr]:[TCP::client_port]: Using host2 pool for [HTTP::host][HTTP::uri]"
return
}
www.host1.com {
switch -glob [string tolower [HTTP::uri]] {
"/itunesu*" -
"/pubservices-war*" -
"/ref_form*" -
"/ccv*" {
pool www.host1-Tomcat
if {$switch_debug}{log local0. "[IP::client_addr]:[TCP::client_port]: Using www.host1-Tomcat pool for [HTTP::host][HTTP::uri]"}
return
}
}
}
}
If we are still in the iRule select the VS default pool
pool $default_pool
if {$switch_debug}{log local0. "[IP::client_addr]:[TCP::client_port]: Using $default_pool pool for [HTTP::host][HTTP::uri]"}
}
when LB_SELECTED {
if {$switch_debug}{log local0. "[IP::client_addr]:[TCP::client_port]: Selected [LB::server]"}
}
when SERVER_CONNECTED {
if {$switch_debug}{log local0. "[IP::client_addr]:[TCP::client_port]: Connected [IP::server_addr]:[TCP::client_port]"}
}
Aaron
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