I would make the code after the redirect an "else" condition on the IF. For example:
when HTTP_REQUEST {
if { [string tolower [HTTP::host] equals "abc.com" } {
HTTP::respond 301 Location "https://abc.com[HTTP::uri]"
} else {
switch -glob [string tolower [HTTP::host]] {
"xyz.com" { pool pool_xyz.com }
default { pool pool_jkl.com }
}
}
}
Other than that, the fact that the variable named uri does not appear to be used anywhere after it is set in your example, and there are only two checks for host name (if it is not abc.com) on the SWITCH rather than four, your code appears to be OK.