Forum Discussion
Strange that your second example works, while the first example makes more sense to me. About the switch command and the default section:
The switch command matches its string argument against each of the pattern arguments in order. As soon as it finds a pattern that matches string it evaluates the following body argument by passing it recursively to the Tcl interpreter and returns the result of that evaluation. If the last pattern argument is default then it matches anything. If no pattern argument matches string and no default is given, then the switch command returns an empty string.
So if there is no match on [LB::server pool] the code in default will be executed. You could start with adding some logging. This will give an idea how far you are getting. Check /var/log/ltm for the logs.
when HTTP_REQUEST {
tell server not to compress response
HTTP::header remove Accept-Encoding
disable STREAM for request flow
STREAM::disable
}
when HTTP_RESPONSE {
switch statement to look at what Service Pool for ReWriting SSL
switch -glob [LB::server pool] {
"PoolLoadBalance1" {
log local0. "DEBUG: match PoolLoadBalance1"
pool pool_443
}
"PoolLoadBalance2" {
log local0. "DEBUG: match PoolLoadBalance2"
pool pool_4445
}
"/PoolLoadBalance3" {
log local0. "DEBUG: match PoolLoadBalance3"
HTTP::cookie remove "TestCookie1"
HTTP::header insert Set-Cookie "TestCookie1=deleted;secure;expires=Thu, 01 Jan 1970 00:00:00 GMT"
}
default {
log local0. "DEBUG: match default"
if { ([HTTP::header value Content-Type] contains "text") } {
log local0. "DEBUG: Content-Type: text"
STREAM::expression {@http://abc.com@https://www.abc.com@@src="http://@src="https://@@123.net@www.abc.com@}
STREAM::enable
}
}
}
}