Forum Discussion
Pramod_Gopala_1
Nimbostratus
Sep 15, 2015Single Virtual Server with Multiple Pools for different URL context
Hi All, At our client site, we need to create a virtual server with multiple pools for different URL contexts. Below is the iRule written for the virtual server: when HTTP_REQUEST {
if {[str...
Stefan_Klotz
Cumulonimbus
Sep 15, 2015Hi,
you should check the ltm-log if any error messages are thrown. And you should add some logging to the iRule to verify what's coming in and which path will be chosen (if any). Something like this:
when HTTP_REQUEST {
log local0. "Host: [HTTP::host], URI: [HTTP::uri]"
if {[string tolower [HTTP::host]] starts_with "www.companyname.net"} {
log local0. "Host starts_with www.companyname.net"
switch -glob [string tolower [HTTP::uri]] {
"/portal1/*" {
log local0. "Pool agentportal-poolname chosen"
pool agentportal-poolname
}
"/ptstest/*" {
log local0. "Pool ptstest-poolname chosen"
pool ptstest-poolname
}
"/pooltest*" {
log local0. "Pool pooltest-poolname chosen"
pool pooltest-poolname
}
"/mob/*" {
log local0. "Pool MOB-poolname chosen"
pool MOB-poolname
}
"/code*" {
log local0. "Pool CODE-poolname chosen"
pool CODE-poolname
}
"/iplc*" {
log local0. "Pool iplc-poolname chosen"
pool iplc-poolname
}
default {
log local0. "No Pool chosen"
}
}
}
}
I also assume you have a HTTP profile assigned to your VS (otherwise you should get an error message when assigning the iRule to your VS) and in case it's a HTTPS-VS you also have a clientSSL-profile assigned.
Ciao Stefan 🙂
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