Forum Discussion
cd_312641
Apr 02, 2019Nimbostratus
Irule redirect to the right pool depending hostname
Hello,
I have a VS which can be accessed from 3 urls, can you help me with an irule on a F5 DMZ VS to redirect to the right node/pool on F5 LAN VS (.45, .46 ,.47) depending to the domain name from which the customer comes
Something like :
if I come from https://aaa.domain.fr redirect to .45 node,
if https://bbb.domain.fr redirect to .46
if https://ccc.domain.fr redirect to .47
This, could be working ?
when HTTP_REQUEST {
Check requested host header (set to lowercase)
switch [string tolower [HTTP::host]] {
"https://aaa.domain.fr" {
pool AAA_Pool
}
"https://bbb.domain.fr" {
pool BBB_Pool
}
default {
pool CCC_Pool
}
}
Thanks
- CharlesCSCirrus
The HTTP::host item does not include the "; text. Try this:
when HTTP_REQUEST { Check requested host header (set to lowercase) switch [string tolower [HTTP::host]] { "aaa.domain.fr" { pool AAA_Pool } "bbb.domain.fr" { pool BBB_Pool } default { pool CCC_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