site maintenance
1 TopicServing images via iRules from v11.1
Perhaps a better title would be "What Am I Missing?" I wanted to implement a Maintenance page for use when we have servers down for work. We're using BigIP v11.1. The first thing I found when searching the web was an article on RESDEV-OPS (http://www.resdevops.com/2013/01/25/hosting-maintenancesorry-site-from-a-f5-nlb/), which was essentially a version of this DevCentral article: https://devcentral.f5.com/wiki/iRules.LTMMaintenancePage.ashx. The author of the RESDEV-OPS piece mentioned some new capability in v11.1 over v10.x using iFiles, and since I didn't have his need to make it work on v10, I looked into that. This lead me to Jason Rahm's DevCentral very nice article on the subject (https://devcentral.f5.com/articles/v111-ndashexternal-file-access-from-irules-via-ifiles) which outlined the use of iFiles for this purpose. This seemed a lot simpler, so I worked up a similar solution for my page. My maintenance page is quite simple; it just displays some text and an image. Here is the iRule: when HTTP_REQUEST { set VSPool [LB::server pool] if { [active_members $VSPool] < 1 } { log local0. "Client [IP::client_addr] requested [HTTP::uri] no active nodes available..." if { [HTTP::uri] eq "/x_logo.png" } { HTTP::respond 200 content [ifile get maint_logo_img] "Content-Type" "image/png" } else { HTTP::respond 200 content " Please Excuse Our Absence PeopleSoft at the Org X is currently down for maintenance. We promise to be back online soon, though. For more information, see our . Thank you for your patience! " } } } Great so far. The image was uploaded to the F5 using the procedure in Jason Rahm's article, and is referenced as the iFile maint_logo_image. After attaching this to a test virtual server, and turning off the pool members attached to it, indeed the page comes up. All except for the image. The effect is different for different browsers. Chrome will try to show the image. If you keep refreshing, the image will show transiently as the page loads. Many times it will show a blurred or highly pixellated version of the image if I go to the /x_logo.png URL. Firefox usually will not show the image under any circumstances, but will transiently show an error message saying "there were errors in the image and it couldn't be displayed". IE actually will attempt to render the image, and gets about 30% of it. So in IE, I see a truncated image, or a highly pixellated image. Here's an example from IE: This leads me to believe that there's something wrong with the image or with the way I uploaded it to the F5. I even got so desperate that I took F5's advice and redid the way I presented the images according to the 10.x article, base64-encoding the image into a class datagroup. No dice. I got similar results. I have tried other images, with similar results as well. It seems pretty obvious that I'm doing something wrong here, but I can't figure out what it is from the sources that I have looked at. Has anyone out there had similar issues, or does anyone have an idea as to what might be wrong?461Views0likes7Comments