Let's say I have an HTTP configuration block like so:
listen testing
bind 1.2.3.4:80
balance roundrobin
use-server server1 if { urlp_val(force) eq 1 }
use-server server2 if { urlp_val(force) eq 2 }
force-persist if { urlp(offline) -m bool }
cookie SRVID insert indirect nocache
server server1 1.2.3.5:9000 cookie 1
server server2 1.2.3.6:9000 cookie 2
Then, at some point, I disable server2
via the socket interface so that all connections to it are now forced over to server1
. But server2
isn't really offline, it is just undergoing maintenance and it should be checked before being re-enabled. So requesting http://1.2.3.4/?force=2&offline=true
should be proxied to server2
. But that's not happening, it's being proxied to server1
.
If I add option persist
then persistence will stay and no one will be directed to server1
since server2
wasn't really unavailable.
How can I accomplish my goal of stopping automatically load balanced traffic from going to server2
but force conditional traffic to it when it is disabled?
0 Answers