Forum Discussion
Daniel_Reznicek
Aug 20, 2012Nimbostratus
Direct hundreds of clients to 10's of pools by URI
We have hundreds of customers, each with their own website. These websites are on pools of servers with approx 50 sites per pool. The customers are redirected via a website doing a sql query to find t...
nitass
Aug 21, 2012Employee
in case of using data group.
e.g.
[root@ve10:Active] config b virtual bar list
virtual bar {
destination 172.28.19.79:80
ip protocol 6
rules myrule
profiles {
http {}
tcp {}
}
}
[root@ve10:Active] config b rule myrule list
rule myrule {
when HTTP_REQUEST {
if {[string tolower [HTTP::host]] equals "www.website.com"} {
scan [HTTP::uri] {/%s} cust
set pl [class match -value $cust equals redirect_class]
if {$pl ne ""} {
HTTP::redirect "http://[string map "www $pl" [string tolower [HTTP::host]]][HTTP::uri]"
}
}
}
}
[root@ve10:Active] config b class redirect_class list
class redirect_class {
{
"customer1" { "pool1" }
"customer2" { "pool13" }
"customer3" { "pool4" }
}
}
[root@ve10:Active] config curl -I http://172.28.19.79/customer1 -H "Host: www.website.com"
HTTP/1.0 302 Found
Location: http://pool1.website.com/customer1
Server: BigIP
Connection: Keep-Alive
Content-Length: 0
[root@ve10:Active] config curl -I http://172.28.19.79/customer2 -H "Host: www.website.com"
HTTP/1.0 302 Found
Location: http://pool13.website.com/customer2
Server: BigIP
Connection: Keep-Alive
Content-Length: 0
[root@ve10:Active] config curl -I http://172.28.19.79/customer3 -H "Host: www.website.com"
HTTP/1.0 302 Found
Location: http://pool4.website.com/customer3
Server: BigIP
Connection: Keep-Alive
Content-Length: 0
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