Forum Discussion
skkg_111590
Nov 12, 2010Nimbostratus
need irule help
I need help as I am new to irule
When user tries to go to
1. http://abc.com/secure/* ----------it should redirect to https://abc.com./secure/* --works all fine.
when HTTP...
Hi Vincent,
(1) When there are no active members in the pool (all backend nodes are down), how can I close the client connection?
you may try this way...
note that return value of active_members may not be the same as number of current active connection for the particular client connection.
you could keep track that by using variable. here are 2 examples
example I
when CLIENT_ACCEPTED {
check every second
after 1000 -periodic {
if { [active_members [LB::server pool]] == 0 } {
reject
log local0. "TCP connection closed to [TCP::local_port]."
}
}
}
example II
when CLIENT_ACCEPTED {
array set server_array {}
check every second
after 2000 -periodic {
if { [array size server_array] == 0 } {
reject
log local0. "TCP connection closed to [TCP::local_port]."
}
}
}
when SERVER_CONNECTED {
set s "[IP::remote_addr] [TCP::remote_port]"
set server_array($s) 1
}
when SERVER_CLOSED {
set s "[IP::remote_addr] [TCP::remote_port]"
unset server_array($s)
}
(2) to periodically send somethig to server every 30 seconds, you can do as follow
when SERVER_CONNECTED {
send ping every 30 seconds
after 30000 -periodic {
you could add some code to check idletime here...
TCP::respond $static::conn_ping
}
}
May I ask what is your use case that you are using mblb profile for?
This information would help us improve future version of mblb profile 🙂
Thanks,
Nat
v