Forum Discussion

Thanushka_Wije1's avatar
Thanushka_Wije1
Icon for Nimbostratus rankNimbostratus
Sep 14, 2018

multiple uri and url filtering

Hi All

 

I have a requirement to craft an iRule to allow only specific uri's and url's for specific virtual server with two particular hosts

 

I have crafted the below irule, but unfortunately it's not correctly compiling

 

when HTTP_REQUEST { if { not ([HTTP::host] equals "auto.abc.com " || [HTTP::host] equals "auto-alb1.abc.com")} { switch [HTTP::uri]{ "/auto/auto.svc" "/auto/auto.svc/security" "/auto/auto.xml" then { drop } } } }

 

any thoughts on how to get it worked ?

 

1 Reply

  • this one may compile succesfully

    when HTTP_REQUEST { 
      if { not ([HTTP::host] equals "auto.abc.com " || [HTTP::host] equals "auto-alb1.abc.com")} { 
        switch [HTTP::uri]{ 
          "/auto/auto.svc" - "/auto/auto.svc/security" - "/auto/auto.xml" { drop } 
        } 
      }
    }