Forum Discussion
JamesSevedge_23
Historic 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
Feb 23, 2016Nimbostratus
I 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.