Forum Discussion
Yugandhar
Nimbostratus
Jun 15, 2018Pool Selection and Persistence using iRule
Hi,
Can we forward traffic to a particular pool based on the host(domain) section of the URL and apply persistence of 500ms using the below iRule.
when HTTP_REQUEST {
if { [str...
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
}
}
}
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects