Sorry page when all servers are down
in aFleX
Posted by ddesmidt
I received an interesting request today.
A customer wanted his AX to reply itself a sorry page when all the servers behind the VIP are down => users requests are not dropped but they receive a "sorry" web page.
Here is the aFleX I shared with him:
Code:
I received an interesting request today.
A customer wanted his AX to reply itself a sorry page when all the servers behind the VIP are down => users requests are not dropped but they receive a "sorry" web page.
Here is the aFleX I shared with him:
Code:
when HTTP_REQUEST {
# log "LB::status = [LB::status pool Server_Eng_HTTP]"
if {[LB::status pool Server_Eng_HTTP] == "down" } {
HTTP::respond 200 content "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"> <html>
<head> <title>My company app</title> <meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\"> </head>
<body topmargin=\"0\" leftmargin=\"0\">
<div align=\"center\">
Welcome to our web application. The service is momentarily unavailable and will be back online promptly.
</div>
</body>
</html>
"
}
}
0