Host to pool mapping
Previously, we were doing the normal www.xyz.com/customer, but do to an application change we now have to specify the customer in the host.
We currently have to configure a separate public VIP for each one of our customers. We would like to be able use only one public IP, but be able to direct the customer to a specific pool based on the host. Here's an example:
customer1.xyz.com send to pool1
customer2.xyz.com send to pool2
customer3.xyz.com send to pool3
etc.
Here's one idea I had, but it's not scalable if I have a lot of customers.
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::host]] {
if { [HTTP::host] starts_with "customer1" } {
pool pool1
elseif { [HTTP::host] starts_with "customer2" } {
pool pool2
elseif { [HTTP::host] starts_with "customer3" } {
pool pool3
}
}
Is there a better way to do this? I have about 50 customers I need to configure this for.
Thanks,
Harton