Forum Discussion
Jeff_Bilder_413
Aug 29, 2011Nimbostratus
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 t...
hooleylist
Aug 30, 2011Cirrostratus
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
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