Forum Discussion
rwagner1
Nimbostratus
Aug 09, 2017iRule Host Header Pool
I'm new to F5 iRule scripting and I'm looking to simplify the following so we don't have to edit the iRule every time we add a new site and pool.
Current
when HTTP_REQUEST {
if { [HTTP::h...
CharlesCS
Cirrus
Aug 09, 2017This is quick-and-dirty, and doesn't allow for the virtual server receiving a request with an invalid host header:
when HTTP_REQUEST {
pool [HTTP::host]
}
If you want to get fancier, create a data group ("known_hosts", for example) whose entries are valid host names (and for which you've already created the corresponding pool).
when HTTP_REQUEST {
if { [class match [HTTP::host] equals known_hosts] } {
pool [HTTP::host]
} else {
take appropriate action
}
}
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