iRule ProxyPass or Rewrite needed? Not sure

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:

user ---> www.website.com/businessojects → production pool on /businessobjects/

user ---> www.website.com/businessobjects-uat → uat BO pool on /businessobjects/

user ---> www.website.com/businessobjects-sales → sales BO pool on /businessobjects/

Is this possible? What would be the best method of accomplishing this? Appreciate all the help!

Thanks!

Hi Jeff,

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.

Aaron