Forum Discussion
I would like to redirect incoming HTTP requests to two different ports on different pools
So this is incoming requests to a URL that is redirected in a load balanced manner to two different URIs with different ports. For example, http://test.web.com redirects sometimes to http://test.web.com:1000 and sometimes to http://test.web.com:2000.
I tried this with multiple pools and a * VS and irule, but that didn't quite work. I've also tried multiple pools, irules, and VSs, but it will always choose the first irule on the main VS (port 80 VS), and never redirect to the second pool.
Any help would be appreciated.
4 Replies
- Kevin_Stewart
Employee
Is there a specific URI pattern that you're looking for?
when HTTP_REQUEST { switch -glob [string tolower [HTTP::uri]] { "/uri1*" { pool uri1_pool } "/uri2*" { pool uri2_pool } default { pool default_pool } } } - sysop_182859
Nimbostratus
Unfortunately, no. That's partly why this seems so difficult. There isn't anything to key off to make a pool decision, except for different ports. The client however will not know about the ports because they are only hitting port 80. I need to somehow redirect incoming requests from 80 to those two other ports, and do so in a round robin fashion, yet still allow for failure detection. I tried yesterday with GTM, using a translation at the GTM VS layer, but that didn't work....
- Kevin_Stewart
Employee
Okay, so if you need to just round robin through different servers on different ports, add all of these servers (IP and port) to a single pool and make sure address and port translation are enabled in the virtual server configuration. The client will communicate via port 80 to the VIP and the VIP will load balance to each of these servers.
- sysop_182859
Nimbostratus
Ha! That was much easier than I thought it would be. I wasn't aware of the port translation piece. Many thanks my friend!
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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