Forum Discussion
Jun 17, 2018
Yes it's possible to forward traffic to a specific pool based on the HTTP host header. As far as I know it's not possible to persist with a timeout specified in milliseconds. The timeout for persistence should be in seconds. For an iRule like this, it's better to use the switch function. See example below.
when HTTP_REQUEST {
switch [string tolower [HTTP::host]] {
"ad.test.xya.com" {
pool xya_Test--pool
}
"bc.test.xya.com" {
pool xya_Test--pool
}
"vf.test.xya.com" {
pool xya_Test--pool
}
"lg.test.xya.com" {
pool xya_Test--pool
persist source_addr
}
default {
pool Default_VIP--pool
}
}
}