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 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_72728NimbostratusLooks 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_BhattmanNimbostratusHi Natalia,
- Pconlan_71037AltocumulusI use yet another variation similar to what Peter and Bhattman suggested:
- Natalia_WolosecNimbostratusHi Guys,
- JRahmAdminyep, 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_684NimbostratusHi It's Natalia,
- hooleylistCirrostratusThe switch command should work in any LTM version. What's the exact iRule you tried and what error did you see?
- nwoloseckyj_684Nimbostratusswitch -glob [string tolower [HTTP::path]]
- nwoloseckyj_684NimbostratusThis is the error I get:
- hooleylistCirrostratusCan 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