Forum Discussion
Chris_Robert_10
Nimbostratus
Jan 22, 2009sub site iRule
I have been asked to help in a site redesign.
They want to have 12 sub sites go to one set of servers and everything else go to another set.
The URL must not change in th...
hoolio
Cirrostratus
Jan 22, 2009Hi Chris,
You could use a single VIP which www.mysite.com resolves to. You could then use an iRule to send requests for /site1/ - /site12/ to one pool and all other URIs to the second pool. If that sounds about right, you could use an iRule like this:
when HTTP_REQUEST {
Check the requested path
switch -glob [HTTP::path] {
"/site[1-9]/* -
"/site1[1-2]/* {
Request matched /site1/* - /site12/* so use first pool
pool first_pool
log local0. "[IP::client_addr]:[TCP::client_port]: Using first_pool for request to [HTTP::uri]"
}
default {
Request didn't match so use second pool
pool second_pool
log local0. "[IP::client_addr]:[TCP::client_port]: Using second_pool for request to [HTTP::uri]"
}
}
}
If you see omega Ώ symbols in the switch statement, replace the lines wtih these (minus the spaces):
"/site [ 1 - 9 ]/* -
"/site1 [ 1 - 2]/* {
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
