Load balance URIs to different pools.
Desired URI to pool mapping:
http://www.foo.com/development/ --> Pool 1 http://www.foo.com/marketing/ --> Pool 2 http://www.foo.com/support/ --> Pool 3
when HTTP_REQUEST {
if {[HTTP::uri] starts_with "/development" } {
pool pool_development
} elseif {[HTTP::uri] starts_with "/marketing" } {
pool pool_marketing
} elseif {[HTTP::uri] starts_with "/support" } {
pool pool_support
}
else {
discard
}
}
Pools has to be attached to datascript.
-- HTTP_REQ
if avi.http.get_path() == "/development" then
avi.pool.select("pool_development")
elseif avi.http.get_path() == "/marketing" then
avi.pool.select("pool_marketing")
elseif avi.http.get_path() == "/support" then
avi.pool.select("pool_support")
else
avi.http.close_conn()
end