Forum Discussion
Natalia_Wolosec
Nimbostratus
Aug 01, 2011Irule 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 certificate, but to reroute to another pool of test servers which using a /test on the url.
So for example www.example.com to go to the existing pool members (poollive) and www.example.com/test to go to a new test pool of members (pooltest)
I've created an irule to try to get this to do this procedure.
Can anyone confirm if this irule is correct, or needs some additional work.
when HTTP_REQUEST {
if { [HTTP::uri] contains "test" }
pool pooltest
}
else {
pool poollive
}
}
Can someone advise if this would be correct?
Thanks,
- Peter_72728
Nimbostratus
Looks like a reasonable start...switch -glob [HTTP::uri] { "/test*" - "/another_url_that_shouldnt_be_live/index.htm" { pool pooltest } "/someOtherPool*" {pool poolother) default { pool poollive } }
- The_Bhattman
Nimbostratus
Hi Natalia, - Pconlan_71037
Altocumulus
I use yet another variation similar to what Peter and Bhattman suggested: - Natalia_Wolosec
Nimbostratus
Hi Guys, - JRahm
Admin
yep, that should work fine. If you want another layer of feel-good before applying to your live virtual, you could create a dummy virtual with the same parameters and apply your rule there to make sure it does as you expect before applying to the prod traffic. - nwoloseckyj_684
Nimbostratus
Hi It's Natalia, - hoolio
Cirrostratus
The switch command should work in any LTM version. What's the exact iRule you tried and what error did you see? - nwoloseckyj_684
Nimbostratus
switch -glob [string tolower [HTTP::path]] - nwoloseckyj_684
Nimbostratus
This is the error I get: - hoolio
Cirrostratus
Can you put it in the HTTP_REQUEST event?when HTTP_REQUEST { switch -glob [string tolower [HTTP::path]] { "/new*" { pool new} default { pool default } } }
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