There are 3 steps to creating the F5 iRule to serve the image of a sorry page. Serving image of sorry page is utilized when you need to serve non-English characters which may not be compatible with F5. Of course, you can use it even for simple sorry pages with English characters.
There are 3 main steps:
- Create a base64 image of the original Sorry Page Image
- Create a datagroup that references the base64 Sorry Page Image
- Create an iRule that reference the datagroup and attach this to the Virtual Server that requires the Sorry Page iRule.
Create a base64 image of the original Sorry Page Image:
- Copy the image (SORRY_IMAGE.png – this should be less than 46KB in size) onto F5’s directory
- The following command should be copied to the F5 shell as a single line in order to create the base64 image
echo \"SORRYIMAGE\" \:\= \"`base64 /var/tmp/SORRY_IMAGE.png | xargs echo | sed 's/ //g'`\"\, > /var/class/SORRY.class
- Check /var/class/SORRY.class
[root@f5-ltm:Active] config # head /var/class/SORRY.class
"SORRYIMAGE" := "iVBORw0KGgoAAAANSUhEUgAABAAAAAMACAMAAACNZOU/A ...... <<remaining output omitted>>
Create a datagroup that references the base64 Sorry Page Image via GUI: