Forum Discussion
DannyG
Nimbostratus
Nov 02, 2017Help with iRule to route by host header to pool
Hello,
I am trying to save public IPs with an iRule by using the hostname and mapping it to the pool. The rule came from here but I can't find the original thread but it seems to work but I wanted...
DannyG
Nimbostratus
Nov 02, 2017Thanks for the help in advance!
The datagroup will be string and be formated like hostname:poolname
when HTTP_REQUEST {
test_dg is a string data-group where the entries are name:value pairs
name is the requested HTTP host header, value is the associated pool-name
check the requested HTTP host header against entries in data-group
if { [class match [string tolower [HTTP::host]] equals test_dg ] } {
if the HTTP host header is in datagroup
send the request to the pool associated with the datagroup entry
pool [class match -value [string tolower [HTTP::host]] equals test_dg ]
} else {
drop the request if the host header is not in datagroup
drop
}
}
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