Forum Discussion
Parveez_70209
Nimbostratus
Nov 08, 2013Syntax to Map Virtual-Server's Character with Data-Group which Contains Pool Name
Kindly have a look into the below Irule:
1.Last part of the Data-Group: dg_parveez_dynamic_pools contains a list of all dynamic pools:
2.Idea is to apply/create a single Irule into the future and a...
Kevin_Stewart
Employee
Mar 11, 2014when HTTP_REQUEST {
if { [class match [IP::client_addr] equals my_whitelist_dg] } {
switch -glob [string tolower [HTTP::uri]] {
"/" {
log local0. "redirecting from /"
if { [class match [virtual] equals dg_confarm_pool_routing ] } {
HTTP::respond 301 Location [lindex [split [class match -value [virtual] equals dg_confarm_pool_routing] ","] 2]
pool [lindex [split [class match -value [virtual] equals dg_confarm_pool_routing ] ","] 0]
log local0. "Went to root ( / ), index 0 - WEC pool after index 2 url set with 301"
} else {
log local0. "Static pool entry for xxxx[LB::server pool] not created yet"
reject
}
return
}
"/iss_static*" {
if { [class match [virtual] equals dg_confarm_pool_routing ] } {
pool [lindex [split [class match -value [virtual] equals dg_confarm_pool_routing] ","] 1]
log local0. "Went to default, index 1 - Confarm pool"
} else {
log local0. "Static pool entry for [virtual] not created yet"
reject
}
return
}
default {
if { [class match [virtual] equals dg_confarm_pool_routing ] } {
pool [lindex [split [class match -value [virtual] equals dg_confarm_pool_routing ] ","] 0]
log local0. "Went to default, index 0 - WEC pool"
} else {
log local0. "Dynamic pool entry for [virtual] not created yet"
reject
}
return
}
}
}
}
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