Forum Discussion
iRule to route
I want to create an irule for the below. Is it appropriate to have specific URI's define going to the URI Pool or can we say anything with a URI goes to this pool. Everything else root of example.com goes to another pool
example.com goes to pool Example
and anything else example.com with any URI goes to pool URI_POOL
would this be appropriate:
when HTTP REQUEST { if {[string tolower [HTTP::uri]] contains "/*/}{ pool URI_POOL} else pool EXAMPLE }
2 Replies
- Vijay_E
Cirrus
when HTTP_REQUEST { if { [HTTP::host] eq "example.com" } { if { [HTTP::uri] eq "/" } { pool POOL-EXAMPLE } else { pool POOL_URI-POOL } } } Hi Falooda,
you may try one of the snippets below...
Using a
syntax:[string match]when HTTP REQUEST { if { [string match "/*/*" [HTTP::path]] } then { pool URI_POOL } else { pool EXAMPLE } }Using a
syntax:[switch -glob]when HTTP REQUEST { switch -glob -- [HTTP::path] "/*/*" { pool URI_POOL } default { pool EXAMPLE } }Note: The first example has a slightly better performance.
Cheers, Kai
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