Forum Discussion
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
- Chris_MillerAltostratusEither a switch statement or a datagroup mapped to pool name as value would be my choices.
when HTTP_REQUEST { switch -glob [string tolower [HTTP::host]] { "customer1*" { pool pool1 } "customer2*" { pool pool2 } "customer3*" { pool pool3 } } }
- hartonNimbostratusWow. This looks simple enough. I'll give it a try. I was way over thinking this one.
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