Forum Discussion

wick54's avatar
wick54
Icon for Nimbostratus rankNimbostratus
Sep 25, 2019

Block URIs and forward traffic 2 pools on same VIP

Hi Team,

 

We currently have a requirement for single VIP to service 2 URLs and also to check URI and only allow 4 specific URIs.

I currently have it as 2 different VIPs with 2 pool and have an irule attached to it block URIs as below which is working as expected to allow specific URIs

 

when HTTP_REQUEST {

              switch -glob [HTTP::uri]] 

                             "/abc*" -

                             "/bcd*" -

                             "/efg*" -

                             "/cvy" -

                              {

 

                             }

                             default

                             {

                                            drop

                             }

                          }

               }

 

I have prepared another irule which can be used to pass the traffic specific pool depending on the hostname.

 

when HTTP_REQUEST {

 

set hostname [string tolower [HTTP::host]]

  switch $hostname {

    "abc.com" {

      pool abc_pool

    }

    default {

       do nothing use the pool for VIP

    }

  }

}

 

Can I combine these irules to achieve which i wanted or would it be easier to use ltm policy?

1 Reply

  • You can combined two irule in Single iRule but above requirement is not clear.

     

    Just put the dummy Application name and URL ==> Redirect Pool name

     

    example :

    URL ==>> www.abc.com and URI==> /pqr or /xyz ==> redirect pool ==> pool_A

    URL ==> www.def.com and URI ==> /sat or /hij ==>> redirect pool ==> Pool_B

     

    Hope you understand it.