Forum Discussion

Anuj_Chaudhary_'s avatar
Anuj_Chaudhary_
Icon for Nimbostratus rankNimbostratus
Jan 29, 2016
Solved

VIP redirection

Hi,   We have two pool members.   If user trying is accessible the urlwww.ABC.com traffic should go to both pool members,but if user trying to access the urlwww.ABC.com/xyz traffic should go to...
  • Theo_12742's avatar
    Jan 29, 2016

    This can be done via iRule or Policy (if you are running v11.4+). Personally, I would go with the policy, as it's easier to interpret for those newer to the F5 platform.

    The below examples assumes your pool is named my_pool and you have a member defined with IP address 1.2.3.4 and port 80.

    iRule
    when HTTP_REQUEST {
        if { [HTTP::path] starts_with "/xyz" } {
            pool my_pool member 1.2.3.4 80
        }
    }
    
    Policy
    ltm policy single_member_xyz {
        controls { forwarding }
        requires { http }
        rules {
            xyz {
                actions {
                    0 {
                        forward
                        select
                        member 1.2.3.4:80
                    }
                }
                conditions {
                    0 {
                        http-uri
                        path
                        starts-with
                        values { /xyz }
                    }
                }
                ordinal 1
            }
        }
        strategy first-match
    }