A single VS (3.3.3.3) with two different Pool based on the URI prefix :
Pool A: the member web server 1.1.1.1 is configured on a Virtual Directory /web
Pool B: the member web server 2.2.2.2 is configured on a Virtual Directory /reports
Requirement:
Client browser must connect to the root directory of the Virtual Server and the LTM will use Pool A and add the /web prefix before sending the request to the Pool except /reports which the LTM will use Pool B and pass through the URI with no changes
I have finally get it working and here is the final irules that I use. I add some log command as a troubleshooting tool to log the variable in the /var/log/ltm
Add /web prefix
Unless it started with /reports
when HTTP_REQUEST {
log local0. "in HTTP_REQUEST"
set orguri [HTTP::uri]
log local0. "Original: $orguri."
if {[string tolower $orguri] starts_with "/reports"}
{
pool pool_b
}
else {
set newuri "/web[HTTP::uri]"
HTTP::uri $newuri
pool pool_a
}
log local0. "After mapping: [HTTP::uri]"
log local0. "Pool: [LB::server pool]"
}