Forum Discussion

kykong_107132's avatar
kykong_107132
Icon for Nimbostratus rankNimbostratus
Jul 20, 2005

redirect plus use pool

Hi All,

 

 

I have a requirement, the scenario is something like this.

 

 

www.abc.com map to VS IP (192.168.10.1)

 

 

if someone access to http://www.abc.com/test/

 

i like to send the connection to an ip address 192.168.10.2 at the sametime redirect the http_uri to connect.

 

 

http://www.abc.com/test/ -> http://www.abc.com/connect/

 

 

i have sometime here

 

==========================================

 

if (http_uri == "/test/") {

 

redirect to "http://%h/connect/"

 

}

 

else if (http_uri == "/connect/") {

 

use pool pool_192.168.10.2

 

}

 

============================================

 

 

i tested this rules is working but wondering is there any other way to configure this.
  • Martin_Machacek's avatar
    Martin_Machacek
    Historic F5 Account
    I can't think of any better way how to achieve your desired behavior. Waht you have is IMHO the simplest and most effiecient solution. You should though consider changing your rule slightly. Unless you really want to discard all requests with URIs other than /test/ or /connect/ you should use:

    
    if (http_uri == "/test/") {
       redirect to "http://%h/connect/"
    } else {
       use pool pool_192.168.10.2
    }

    BIG-IP discards all requests not matching any condition in a rule.