iRule to display static HTML 'sorry' page on empty pool not rendering on IE, Firefox - Chrome works
Good day all,
I am using a version of an iRule that I found here which is meant to display a static 'sorry' page when the pool members of a VIP reach 0. I put this in place but it came to my attention that it does not render at all from IE and firefox doesn't show an image. Chrome seems to work okay. I can't tell if I have some problem with the html I copied from another system here or if I am making a wrong assumption about how the static content can be displayed. Thanks if anyone has any ideas:
```
when LB_FAILED {
if { [active_members [LB::server pool]] == 0 } {
HTTP::respond 302 content {
Customer
This service is currently unavailable.
We apologize for the inconvenience.
Please contact the Service Desk at
N-NNN-NNN-NNNN for further assistance
}
}
}
```
UPDATE: Something (I don't know what) is keeping some of the images from rendering correctly in IE. changed it to a different image it works a treat with the below configuration (external image, 503, html inline in the irule).
Thanks again for the assistance.
Thanks all for the suggestions. I tried it as a 200 and am currently sending a 503 at the customer's request.
when LB_FAILED { if { [active_members [LB::server pool]] == 0 } { HTTP::respond 503 content { <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd"> <HTML xmlns="http://www.w3.org/1999/xhtml"> <HEAD> <TITLE> Customer </TITLE> <META http-equiv=Content-Type content="text/html; charset=utf-8"> <STYLE type=text/css>BODY { FONT-SIZE: 15px; COLOR: #666; FONT-FAMILY: Arial, Helvetica, sans-serif } TD { FONT-SIZE: 15px; COLOR: #666; FONT-FAMILY: Arial, Helvetica, sans-serif } TH { FONT-SIZE: 15px; COLOR: #666; FONT-FAMILY: Arial, Helvetica, sans-serif } BODY { MARGIN: 30px 0px 0px; BACKGROUND-COLOR: #fff } SPAN { FONT-WEIGHT: LIGHTER; FONT-SIZE: 120px; COLOR: #ccc; FONT-FAMILY: Arial, Helvetica, sans-serif } </STYLE> </HEAD> <BODY> <TABLE cellSpacing=0 cellPadding=0 align=center border=0> <TBODY> <TR> <TD style="PADDING-RIGHT: 80px"> <p>This service is currently unavailable.</p> <p>Please contact the Service Desk at<br> 1-800-123-4567 for further assistance</p> </TD> <TD> <SPAN style="FLOAT: left" class="LARGELIGHT"> ( </SPAN> </TD> <TD vAlign=center> <SPAN style="FLOAT: right; VERTICAL-ALIGN: middle"> <IMG alt="Customer" src="https://www.customer.com/img/media-downloads/logo-customer-lores.jpg" width="400" height="100"> </SPAN> </TD> </TR> </TBODY> </TABLE> </BODY> </HTML> } } }
Still renders correctly on Chrome and Firefox, not on IE.
Here's a how the html document looks - I realize that it may be better to put the image on the LTM as an ifile. It's as likely to be removed in the future as the external image is I suppose.
< ifile not used >