Forum Discussion
abhy201
Nimbostratus
Mar 19, 2018Content Switching for URL using iRule and different Pools
I am trying to create a basic iRule to switch content. I am using single Vserver and need to switch content for 2 different Http URL's using 2 different pools with associated backends servers.
U...
RossVermette
Nimbostratus
Mar 19, 2018How about something like this,
Create a DataGroup to map "host header names" to Pool mappings. example HOST2POOL_DG
"abc.com" := "POOL01",
"xyz.com" := "POOL02",
when HTTP_REQUEST {
set pool_select_value [class lookup [string tolower [HTTP::host]] HOST2POOL_DG]
pool $pool_select_value
}
or
simple irule:when HTTP_REQUEST {
switch [string tolower [HTTP::host]] {
"abc.com" { pool POOL01}
"xyz.com" { pool POOL02}
}
}
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
