Forum Discussion
SanjayP
Oct 21, 2021Nacreous
This is expected behaviour, as there are 2 matches for HTTP::respond event when server goes down during the scheduled maintenance. This will cause TCL error with multiple redirects and cause reset (RST) to the connection. You can combine both iRules in one and give SORRY page only when server is down out of maintenace window.
when HTTP_REQUEST {
set maintenance 1
set maintenance_start_time "0000";
set maintenance_end_time "2359";
set maintenance_day "Sunday";
scan [clock format [clock seconds] -format {%A %k %M}] {%s %s %s} cur_day cur_hour cur_minute
set cur_time ${cur_hour}${cur_minute}
if { ($cur_day eq $maintenance_day) &&
($cur_time >= $maintenance_start_time) &&
($cur_time <= $maintenance_end_time) } {
set maintenance 0
HTTP::respond 200 ifile "/Common/maintenance.html"
return
}
when LB_FAILED {
if { ([active_members Pool_A] < 1) and ($maintenance == 0) } {
#log local0. "scheduled maintenance going on. no sorry page"
} else {
HTTP::respond 200 ifile "/Common/sorry.html"
}
}