Forum Discussion
KVogel
Nimbostratus
Sep 20, 2019Set up iRule to direct traffic to an IP address based on URL string
Hi, we would like to set up an iRule to direct traffic based on URL to a list of IP addresses. How would I set that up?
Thank you,
Kim V
- DanS92
Cirrus
You can do it like this:
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::host]] {
"abc.domain.com" {
pool Pool_Number1 }
"def.domain.com" {
pool Pool_Number2 }
}
}
Or you can use a local traffic policy like this:
I prefer to use the Local Traffic Policy, because then you can see the pool on the Network Map. The pool doesn't show up on the Network Map with an iRule.
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