I have a businessobject environment for UAT, Sales, Stage, Production. Unfortunately, all the environments happen to use /businessobjects/ as a virtual directory on the BO servers. As such, I need the F5 to handle the separation in environments so that:
You should be able to use a simpler iRule than ProxyPass to select a pool based on the HTTP URI. Do you need to rewrite the URI as well?
when HTTP_REQUEST {
switch -glob [HTTP::uri] {
"/businessobjects-sales*" {
Select the sales pool
pool sales_bo_pool
Rewrite the URI to replace /businessobjects-sales with /businessobjects
HTTP::uri [string map -nocase "/businessobjects-sales /businessobjects" [HTTP::uri]]
}
"/businessobjects-uat*" {
Select the UAT pool
pool uat_bo_pool
Rewrite the URI to replace /businessobjects-uat with /businessobjects
HTTP::uri [string map -nocase "/businessobjects-uat /businessobjects" [HTTP::uri]]
}
"/businessobjects*" {
Select the production pool
pool prod_bo_pool
}
}
}
The switch statement works in that a request for /businessobjects-uat or /businessobjects-sales will be matched before the more general /businessobjects URIs.