Stephane_87808
Nov 20, 2009Nimbostratus
Assign a Pool AND rewrite an url
Hello
Is there a way :
- to assign a POOL of servers
and
- to rewrite the URL (adding a /xx.htm)
when a condition is matched in a irule ?
(of course, I will not declare any Default Pool of server for the corresponding VS)
As we need to start multiple webservers running on differents http ports (http://inter1.alk.com:8031/inter1, http://inter2.alk.com:8032/inter2, http://inter3.alk.com:8033/inter3, etc....), I would like to use only ONE VS and have the benefit from the irule capabilities to select the right pool of servers.
in addition, all the pools of servers we have defined can be the exact same servers, with the same ip addresses : the differents pools are only there to declare the differents ports we will use.
In the example below, the line "pool ..." only means what I would expect.
----------------------------------------
when HTTP_REQUEST {
if {[HTTP::host] equals "inter1.alk.com" and [HTTP::uri] equals "/" }
{
pool Pool_inter1
HTTP::redirect http://[getfield [HTTP::host] ":" 1]:8030/inter1
}
elseif {[HTTP::host] equals "inter2.alk.com" and [HTTP::uri] equals "/"}
{
pool Pool_inter1
HTTP::redirect http://[getfield [HTTP::host] ":" 1]:8031/inter2
}
}
----------------------------------------
Thanks for any help / advice
Stéphane