Forum Discussion

Sandeep_Kumar_1's avatar
Sandeep_Kumar_1
Icon for Nimbostratus rankNimbostratus
Jan 08, 2015

apply different ASM policy based on URI content

Hi,

 

I have three URLs hosted on single server and mapped to one VS on ASM working with single ASM policy as of now.

 

Now, i want to create an irule on LTM to differentiate the traffic having /car and /home in URI path. Further i want two different ASM policies to be applied for the traffic having /car in URI and traffic having /home in URI.

 

Please suggest how to achieve this.

 

I have understanding to segregate the traffic on LTM by creating irule. After creating an irule how i will map this segregated traffic to different policy. DO i need to create two VS server for this or i can assign multiple policies to single VS based on the traffic segregation from LTM.

 

2 Replies

  • nathe's avatar
    nathe
    Icon for Cirrocumulus rankCirrocumulus

    Sandeep,

     

    Whilst an irule could work for you have you considered doing this via HTTP Class profiles (11.3.0 and before) or Local Traffic Policies (11.4.0 and after)?

     

    All the above can be achieved using these two methods without needing iRules.

     

    Hope this helps,

     

    N

     

  • nathe's avatar
    nathe
    Icon for Cirrocumulus rankCirrocumulus

    Out of interest...an irule would use the ASM::enable command. See ASM__enable.

    Something like this:

    when HTTP_REQUEST {
     switch -glob [string tolower [HTTP::uri]] {
            "*/car/*" {
               ASM::enable /Common/car_policy
            }
            "*/house/*" {
               ASM::enable /Common/house_policy 
            }
        }
    }