Forum Discussion
Ken_Mitchell_13
Nimbostratus
Apr 03, 2007Translate uri and balance to different pools?
I have a production application which resides at a uri of /my/application.htm among many nodes in pool “default.” The url for this is abc.def.com.
I have other pools which use the same uri, but are used for testing and development.
Testing should be reached by the URL abc.def.com/testing, and the F5 LTM should use pool “test” and the uri /my/application.htm to load balance.
Development should reached by the URL abc.def.com/dev, and the F5 LTM should use pool “dev” and the uri /my/application.htm to load balance.
I have been unable to use HTTP::redirect and the “pool” syntax in the same "if" or "switch" statement. How do I solve the above problem?
- Colin_Walker_12Historic F5 AccountIf all you're trying to do is use the incoming URI to choose the pool to load balance to, and then update the URI, the code should be pretty straight forward.
when HTTP_REQUEST { if { [HTTP::uri] starts_with "/testing" } { set myPool "test" } elseif { [HTTP::uri] starts_with "/dev" } { set myPool "dev" } HTTP::uri "/my/application.htm" pool $myPool }
- Ken_Mitchell_13
Nimbostratus
Thanks! I incorporated that syntax into a switch statement, just setting myuri and mypool variables in the switch as needed. Then, at the end simply said:
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