This seems like one of these should work. Will need syntax correction most likely
The third one is probably the best one, since the return will mean that its only checked during tcp setup, no need to check every GET/POST request, but it won't hurt on an underutilized LTM.
Return works well for stopping processing of the current irule, and its nice that if there are multiple irules assocated to a VS, the return only exits execution of the current irule, so other irules still execute
Maybe there is an issue using 'return' after a node call, assumption is not, since clearly the original rule is continuing to apply even after tcp setup for subsequent GET/POST requests?
Hope this helps
when HTTP_REQUEST {
if { [IP::remote_addr] equals 1.2.3.4 } {
node 192.168.10.10 80
return
}
if { HTTP::host contains "domain1.com" } {
pool domain1.com_pool
}
elseif {HTTP::host contains "domain2.com" } {
pool domain2.com_pool
}
else {
pool domain.com_pool
}
}
or this
when HTTP_REQUEST {
if { [IP::remote_addr] equals 1.2.3.4 } {
node 192.168.10.10 80
} else {
if { HTTP::host contains "domain1.com" } {
pool domain1.com_pool
} elseif {HTTP::host contains "domain2.com" } {
pool domain2.com_pool
} else {
pool domain.com_pool
}
}
}
this is the closest to the original
when CLIENT_ACCEPTED {
if { [IP::client_addr] equals 1.2.3.4 } {
node 192.168.10.10 80
return
}
}
when HTTP_REQUEST {
if { [HTTP::host] contains domain1.com {
pool domain1.com_pool
}
elseif { [HTTP::host] contains domain2.com {
pool domain2.com_pool
}
else {
pool domain.com_pool
}
}