Forum Discussion
Manasi_Sathe_10
Nimbostratus
Dec 15, 2006Reading the host header and directing to the corresponding pool
I want to write a general i-rule for multiple websites such that on reading the url it pools the right pool. for eg:
say i have a couple of url's say 1.abc.xyz.com
2. ptr.xyz.com
and they each have their assosiated pool.. now i want to write a general i-rule that i don't need to update everytime i have a new website..something on the lines of
when HTTP_REQUEST { if { [HTTP::host] matches_regex "*.xyz.com" }{pool *.xyz.com} }
or any ideas how to use switch statements in irules??
Thanks
- hoolio
Cirrostratus
when HTTP_REQUEST { switch -glob [string tolower [HTTP::host]] { *example.com - *site1.example.net - *site2* { pool first_pool } *site3* - *site4* { pool second_pool } default { pool default_pool } } }
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