Forum Discussion
iRule to load balance traffic based on directory
Hi all,
I am new to iRules and deploying a F5 solution which required traffic to be load balanced based on the directory structure. To give you an overview here's what the setup looks like this:
- Single F5 VIP pointing to multiple pools (4 pools)
- The pools are based on the directories they host
- Pool members are same, however the service port is different
Here's my iRule
when HTTP_REQUEST { switch -glob [string tolower [HTTP::path]] { "/dir1"{ pool pool-1 } "/dir2"{ pool pool-1 } "/dir3"{ pool pool-1 } "/dir4"{ pool pool-2 } "/dir5"{ pool pool-2 } "/dir6"{ pool pool-3 } "/dir-a/dir-b*"{ pool pool-3 } } }
I'd like to know if the above rule is valid and if there's a better way of doing this. Any help will be appreciated.
1 Reply
- amolari
Cirrostratus
it should be valid. What about the default pool (if no match)?
You could achieve that also using LTM policies (instead of iRule), if you have a recent version of the BIG-IP software.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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