Forum Discussion

saurabhk_321062's avatar
saurabhk_321062
Icon for Nimbostratus rankNimbostratus
Aug 14, 2017

Need to redirect a specific URL to a particular node in a pool

I have 3 VIP: VIP1: 1.1.1.1:80 VIP2: 1.1.1.1:443 VIP3: 1.1.1.1:8080

 

The pool members within these 3 VIPs are: member1: 2.2.2.1 member2: 2.2.2.2 member3: 2.2.2.3

 

I want to redirect a specific URL https://abc.com/APICherwell on a VIP 1.1.1.1:443 on member 2.2.2.3. Need to know how to proceed. As per my understanding I will need to create a iRule for this redirection. Kindly help in creating the same.

 

  • I hope your abc.com is resolving to 1.1.1.1 VIP. And you want the traffic to be forwarded to a particular pool member if its starting with URI - /APICherwell, You dint say what the pool of the pool member is, hoping its 443, try the below. Where pool_name is the default pool consisting all the pool members. Map the below to the 1.1.1.1:443 VIP and test it.

    when HTTP_REQUEST {
      if { [HTTP::uri] starts_with "/APICherwell" } {
        node 2.2.2.3 443
        log local0. "APICherwell uri traffic has come, specific pool member selected"
      } else {
        pool pool_name
      }
    }
    

    You can also use -

    pool pool_name member 2.2.2.3 443
    to choose a particular pool member inside a pool. Refer Article for selecting pool members.

  • Snl's avatar
    Snl
    Icon for Cirrostratus rankCirrostratus

    try below

     

    Code
    
    when HTTP_REQUEST {
    if { [HTTP::uri] equals "abc.com/APICherwell" } {
       node 2.2.2.3 80
        else {
    pool default_pool  }} }      
        }