Forum Discussion
Natalia_Wolosec
Aug 01, 2011Nimbostratus
Irule for rerouting to different pools
Hi All,
I currently have an in production virtual server on my F5 which also has a SSL certification. My organisation would like to be able to use the same URL to take advantage of the certi...
Peter_72728
Aug 01, 2011Nimbostratus
Looks like a reasonable start...
I'd suggest this minor change...
if { [HTTP::uri] starts_with "/test" }
That's a little more specific and would avoid the situation where a URL with "test" in the middle is sent to the wrong pool (e.g. /application/testpage.htm should go to poollive)
Once you start using logic like this, it's common to have more URI patterns that need to be sent to another pool. When that happens, I'd recommend going to a format like the following. As the list grows, this tends to be easier to read. (*note this example code is untested)
switch -glob [HTTP::uri] {
"/test*" -
"/another_url_that_shouldnt_be_live/index.htm" { pool pooltest }
"/someOtherPool*" {pool poolother)
default {
pool poollive
}
}
See here for more info about switch...
http://devcentral.f5.com/Tutorials/TechTips/tabid/63/articleType/ArticleView/articleId/244/Switch-Gone-Wild-Using-Wildcards-with-the-Tcl-switch-command.aspx
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