Forum Discussion
sandy16
Altostratus
Nov 13, 2012stream profile to match customer facing uris
Folks,
need help in configuring a stream profile for re-writing uris for a cutomer facing requirement. I have an irule configured on the VIP which basically sends request to different server-poo...
What_Lies_Bene1
Cirrostratus
Nov 13, 2012OK, here's my first attempt. They may be a better way but for now I'm assuming the domain name ends with .com so we can match the start of each URI with .com/. If I just used / it will replace every / in the path and break things. Replace .com with whatever you use.
when HTTP_REQUEST {
STREAM::disable
log local0. "URI = [HTTP::uri]"
switch [string tolower [HTTP::uri]] {
"/devproxy/" {
pool devproxy-pool
set environuri /devproxy/
return
}
"/qaproxy/" {
pool qaproxy-pool
set environuri /qaproxy/
return
}
"/uatproxy/" {
pool uatproxy-pool
set environuri /uatproxy/
return
}
default {
HTTP::respond 200 content "Please use /devproxy to go to the dev-dmz-proxies,
/qaproxy to go to the qa-dmz-proxies,
/uatproxy to go to the uat-dmz-proxies" noserver Content-Type "text/html" Connection Close
}
}
}
when HTTP_RESPONSE {
switch string $environuri {
"/devproxy/" {
STREAM::expression {@.com/@.com/devproxy/@}
STREAM::enable
return
}
"/qaproxy/" {
STREAM::expression {@.com/@.com/qaproxy/@}
STREAM::enable
return
}
"/uatproxy/" {
STREAM::expression {@.com/@.com/uatproxy/@}
STREAM::enable
return
}
}
}
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