Forum Discussion
Syntax to Map Virtual-Server's Character with Data-Group which Contains Pool Name
Hi Kevin,
Tried modifying few things, kindly suggest whether it will work as per our scenario where currently we are trying to put all in one Common Data-Group as you suggested earlier:
Original Request:
when HTTP_REQUEST { set http_uri [string tolower [HTTP::uri]] log local0. "requested [HTTP::uri]" if {$http_uri equals "/" } { HTTP::redirect "http://ctbuild.leni2.com/SEUILibrary/controller/e/web/LenovoPortal/en_US/catalog.workflow:test-home" pool pool_ctbuild.leni2.com_http
log local0. "redirected from /"
return
} elseif { $http_uri starts_with "/iss_static" } {
log local0. "matched /iss_static"
pool pool_confarmct.leni2.com_http
log local0. "pool_confarmct.leni2.com_http defined, [LB::server pool] selected" return
} else {
log local0. "no match for rev. close connection" pool pool_ctbuild.leni2.com_http
}
}
The same has been modified as below:
when HTTP_REQUEST { switch -glob [HTTP::uri] { "/" { log local0. "redirecting from /" if { [class match [virtual] equals Common ] } { HTTP::respond 301 Location [lindex [split [class match -value [virtual] equals Common] ","] 2] pool [lindex [split [class match -value [virtual] equals Common ] ","] 0]
} else {
log local0. "Static pool entry for xxxx[LB::server pool] not created yet"
reject
}
return
}
"/iss_static*" {
if { [class match [virtual] equals Common ] } {
pool [lindex [split [class match -value [virtual] equals Common] ","] 1]
} else {
log local0. "Static pool entry for [virtual] not created yet"
reject
}
return
}
default {
if { [class match [virtual] equals Common ] } {
pool [lindex [split [class match -value [virtual] equals Common ] ","] 0]
} else {
log local0. "Dynamic pool entry for [virtual] not created yet"
reject
}
return
}
}
}
Virtual server name:ctbuild.leni2.com-VS-HTTP
Ist Part URL in Irule: http://ctbuild.leni2.com/SEUILibrary/controller/e/web/LenovoPortal/en_US/catalog.workflow:test-home 2nd Part Static Pool: pool_confarmct.leni2.com_http 3rd Part Static Pool: pool_ctbuild.leni2.com_http
So, Data-Group named Common is configured as :
ctbuild.leni2.com-VS-HTTP:=pool_confarmct.leni2.com_http,pool_ctbuild.leni2.com_http,http://ctbuild.leni2.com/SEUILibrary/controller/e/web/LenovoPortal/en_US/catalog.workflow:test-home
Sincerely looking for your advice into it.
Thanks and Regards Parveez
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