Forum Discussion
Junzo
Nimbostratus
Oct 20, 2021iRule for sorry page and Maintenance page
Hi Implemented 2 iRule to 1 Virtual Server. Sorry.html and Maintenance.html page. Both are working properly individually. case1: server down -> sorry.html case2: maintenance time -> maintena...
spalande
Nacreous
Oct 21, 2021This 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"
}
} Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects