Forum Discussion
sysop_182859
Nimbostratus
Feb 23, 2016URI rewrite based on chosen pool member
The issue is I have servers behind the F5 that only listen on a specific uri. For site.com/login (incoming from users), there are say 3 servers that listen for the following: (server1) site.com/one...
JamesSevedge_23
Feb 23, 2016Historic F5 Account
Based on your question it seems like you are trying to receive requests from users at site.com/login and if it gets load balanced to server 1 changed the uri to be site.com/one, and site.com/two for server 2 etc.. Is that correct? How come each server can't have /login as the URI? Or at least one uri the same for all servers such as "/internallogin"? If that is the case the below iRule should work for simple redirection.
when HTTP_REQUEST {
if {[HTTP::uri] contains "/login"} {
HTTP::uri /internallogin
pool /Common/poolname
}
}
JamesSevedge_23
Feb 23, 2016Historic F5 Account
Although you could try something like the iRule below to accomplish the URI rewrite. For HTTP_RESPONSE you may need to rewrite it back to /login though using "when HTTP_RESPONSE".
when HTTP_REQUEST_SEND {
clientside {
switch [LB::server addr] {
"1.1.1.1" {
HTTP::uri /one
}
"1.1.1.2" {
HTTP::uri /two
}
"1.1.1.3" {
HTTP::uri /three
}
}
}
}
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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