Forum Discussion

Jon_46044's avatar
Jon_46044
Icon for Nimbostratus rankNimbostratus
Oct 02, 2007

Need help with iRule for redirect removal

Our site currently works that it sends users to specific servers using explicate www DNS entries. We'd like to move all servers onto a private network behind the F5 LTMs and only have users log into www only.

 

 

Problem is, our site is written to "load balance" similar users to the same server... i.e. User A and B are both from the same location, access the same info, so they're both sent to server 29, or www29. Problem with this is, "www29" won't exist, once we go private... so we want to write this into into a Hash, Cookie, etc, whatever is easiest but keep the user going to www as far as they're concerned, but keep the LTM persistance to that server for that user.

 

 

Any suggestions on how to do that? We tried doing a Hash Persistance, but we're having trouble with the syntax. Some have told us we need to do this on the HTTP_Request, but from the way we understand it, the user will already have made the HTTP_Request, which logs them into our site, the site (not the LTM) then responds with a redirect (HTTP_Response) to another server... we want the user access that server via the VS, but we don't want the user knowing that they are (as far as the browser is concerned).

 

 

Thanks in Advance for any assistance.
  • Patrick_Chang_7's avatar
    Patrick_Chang_7
    Historic F5 Account
    What you really want is an iRule that choose the back end server appropriately according to something that your application can cause the user to send out.

     

    In the example below, the application is sending out a cookie called trueServer that tells us the real server we want to connect to. In order to make this simpler, each server is in a pool of 1 (named after the name of the server).

     

     

    when HTTP_REQUEST {

     

    switch [HTTP::cookie value "trueServer"] {

     

    www1 { pool www1 }

     

    www2 { pool www2 }

     

    www3 { pool www3 }

     

    www4 { pool www4 }

     

    default { pool default_pool }

     

    }

     

    }