Directing traffic to a specific pool member
I would like to forward traffic to a specific pool member depending on what the URL is. Currently I have an iRule that directs traffic to 1 of 5 pools depending on the URL. Instead of having to create 1 pool for each server, I would like to create 1 pool that contains all 5 servers as members.
Here's the iRule I am using. Can you please let me know if this is good enough or if there is a better way? Thank you!
when HTTP_REQUEST {
set param_1 "/paymentResponse1.jsp"
set param_2 "/paymentResponse2.jsp"
set param_3 "/paymentResponse3.jsp"
set param_4 "/paymentResponse4.jsp"
set param_5 "/paymentResponse5.jsp"
if {[string match $param_1 [HTTP::path]]}{
use pool altaf
}
if {[string match $param_2 [HTTP::path]]}{
use pool barry
}
if {[string match $param_3 [HTTP::path]]}{
use pool doug
}
if {[string match $param_4 [HTTP::path]]}{
use pool engvs109
}
if {[string match $param_5 [HTTP::path]]}{
use pool engvs111
}
}