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
}
}
sysop_182859
Nimbostratus
Feb 23, 2016I wish the backend servers would function like every other web server I've seen! The issue with that code though is the user will always come in with /login and would always be changed to /internallogin before a load balanced decision is made. In that case a user would always be sent to a particular pool with, at least from what I'm thinking, wouldn't change. Unless there was some sort of loop or check to see if a cookie is present maybe. I figured it would be easier to change the uri destined to the server after LTM has already made a decision, then depending on the server it chose use the appropriate uri. Additionally, if possible I'd like for the user to not see what is happening behind the scenes. It isn't really a security concern necessarily, but I think it would be cleaner if they didn't see the change. What you state initially is exactly what I'm looking for.
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