Hi,
prefer use pool assignment instead of node... create one pool for each URL.
- pool_prod : member 10.10.10.10 port 1234
- pool_test : member 10.10.10.10 port 4567
- pool_dev : member 10.10.10.10 port 8911
use Local traffic policy :
- requires : http
- controls : forwarding
-
rule 1 :
- condition : http-uri path starts_with /prod
- action : forward pool pool_prod
-
rule 2:
-
rule 3:
-
rule 4 (default):
- condition : none
- action : forward pool def_pool
if you really want to use irule, use switch command:
when HTTP_REQUEST {
switch -glob [HTTP::path] {
"/prod*" {
pool pool_prod
}
"/test*" {
pool pool_test
}
"/dev*" {
pool pool_dev
}
default {
pool def_pool
}
}
}