Forum Discussion
Irule help with creating a single VIP but with multiple pools
I have a website called 'bigip.com', however, I also have a website call 'bigip.com/blog' and 'bigip.com/application' using the same VIP. Each url needs to point to a different pools. How can I write an iRule where bigip.com point to a pool called 'bigip' on port 1000 and bigip.com/blog points to a pool called 'bigip2' on port 2000 and bigip.com/application points to a pool called 'bigip3' ??
Thanks for any help
3 Replies
- Steve_M__153836
Nimbostratus
Here is a tutorial: iRules 101 - Selecting pools, nodes
This should work for you. Your port number is controlled in the pool itself so there is no need to specify that in any way. Also depending on the use case you may want to use "contains" or "starts_with" instead of "eq" in the second and third condition of this iRule.
when HTTP_REQUEST { if { [HTTP::uri] eq "/" } { pool bigip } elseif { [string tolower [HTTP::uri]] eq "/blog" } { pool bigip2 } elseif { [string tolower [HTTP::uri]] eq "/application" } { pool bigip3 } If no pool is configured in the virtual as a default/fallback default { pool bigip } }- Ron_130795
Nimbostratus
Thanks Steve. I appreciate your help.
- David_Larsen
Employee
This is how I do what your are looking to do. I updated /blog_ to /blog* and /application_ to /application*.
when HTTP_REQUEST { Check requested uri header (set to lowercase) switch -glob [string tolower [HTTP::uri]] { "/blog*" { pool bigip2 } "/application*" { pool bigip3 } default { pool bigip } } }
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