Forum Discussion

mplaksin0's avatar
mplaksin0
Icon for Cirrus rankCirrus
Oct 18, 2022
Solved

irule uri traffic redirection failing

Hello team, I have to implement an irule to redirect traffic based on URL. So i made following code: when HTTP_REQUEST { if { [HTTP::uri] starts_with "/specialurl" } { snatpool /NAT_Outside po...
  • Paulius's avatar
    Nov 02, 2022

    mplaksin0First I would create a /32 netmask OneConnect profile and associate it with the virtual server in question. After you have done that use the following iRule configuration replacing whatever you might want to match in the if statement but leave everything else and that should solve your issue.

     

     

    when CLIENT_ACCEPTED {
    
        set DEFAULT_POOL [LB::server pool]
    
    }
    
    when HTTP_REQUEST {
    
        if { [HTTP::uri] starts_with "/specialurl" } {
            snatpool NAT_Outside
            pool Apps_pool  
            log local0. "[IP::client_addr] Ingreso a [HTTP::uri]"
        } else {
            pool $DEFAULT_POOL
        }
    
    }