Forum Discussion
johnko05_45751
Nimbostratus
Jul 25, 2008Virtual Hosts
My application requires numerous VIPs (20+) in order to operate. This obviously requires high numbers of public and private addresses. Can someone send me an example of an iRule to use Virtual Hosts...
hoolio
Cirrostratus
Jul 28, 2008If the application uses HTTPS, this becomes more complicated as you can only really support one SSL cert on a single VIP. Here is one method for HTTP where you select the pool based on the HTTP host header value:
when HTTP_REQUEST [
Make a pool selection based on the host header value (set to lowercase)
switch [string tolower [HTTP::host]] {
"test1.example.com" {
test1
log local0. "[IP::client_addr]:[TCP::client_port]: test1.example.com, using test1 pool"
pool test1_pool
}
"test2.example.com" {
test2
log local0. "[IP::client_addr]:[TCP::client_port]: test2.example.com, using test2 pool"
pool test2_pool
}
"test3.example.com" {
test3
log local0. "[IP::client_addr]:[TCP::client_port]: test2.example.com, using test3 pool"
pool test3_pool
}
default {
didn't match specific case
log local0. "[IP::client_addr]:[TCP::client_port]: hit default, using pool1"
pool test1_pool
}
}
}
I'm guessing this won't exactly match your scenario, but hopefully it gets you started.
Aaron
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