pool selectction base on context root .

I have requirement to select pool base on context root. I created two pools and use below irule, however it didn’t work, under virtual server I didn’t apply any pool under Virtual server ? is that why below iRule didn’t work? when HTTP_REQUEST { switch -glob [string tolower [HTTP::uri]] { “/outpool" { pool outpool_7001_Pool } "/Inpool” { pool Inpool_7003_Pool } }

}

Thx

If you select a pool via an iRule there’s no need to configure a default pool. A drawback is that you can’t readily tell whether a VIP is up or down since it doesn’t have any pool members.

As for your iRule, it will do an exact match of “/outpool” and “/inpool”. My guess is that you’ll want to select pools based on the beginning of the path. You can do that by adding an asterisk (*) at the end of the string.

when HTTP_REQUEST { 

switch -glob [string tolower [HTTP::uri]] { 

    "/outpool*" { 

        pool outpool_7001_Pool 

    } 

    "/Inpool*" { 

        pool Inpool_7003_Pool 

    } 

} 

}

PS I just noticed that you used a capital “I” in “Inpool”. You’ll want to change that to lower case.

Thank you so much, that was it , Capital “I”.

appreciate quick response.

Glad to help. Would you mind marking the response as the answer?

Thank you so much, that was it , Capital “I”.

appreciate quick response.