Samuel_Neff_133
Dec 22, 2014Nimbostratus
Need Direction - URI Rewrite + Pool Selection
I have been asked to see if the F5 can accomplish a few things. And I need some direction. 1. We have an in-house application that runs on a pair of webservers, we want users to have one url to use and be sorted between the webservers base upon uri. I have done something similar with an iRule before and it would look like this:
when HTTP_REQUEST {
Check URI set to lower case with wildcard matching
log local0. "Requested hostname: [HTTP::host] from IP: [IP::local_addr] and URI: [HTTP::uri]"
switch -glob [string tolower [HTTP::uri]] {
"/raloh*" {
pool pool_WES-PROD-http-8080
}
default {
pool pool_WES-PROD-http-8081
}
}
}
- We want to remove the first section of the URI and replace with /UI/Portal/ as the the webserver on the other side cannot make since of the part of the URI(/raloh) that they want to use to switch between servers. So One user goes to test.WESserver.com/raloh/UI/Portal - should go to the 8080 pool as /UI/Portal. The second user goes to test.WESserver.com/mumrah/UI/Portal - should go to the 8081 pool as /UI/Portal
So I was thinking content rewrite could be used to do this, as the external DNS name is different from the internalm port is different IP and DNS are the same internally, but how to switch and strip the first section?