Forum Discussion
how can I add logo to ifile and irule
Hope it clear .I was able to display 503 error once pool members are down, using iFile and irule, but it is very plain Text, and would like to add logo to it. how can I add logo to ifile ?below is the ifile and irule,
this is my ifile:
The system is unable to fulfill your request. This is not a problem with your computer or network connection. Try again later.
this is irule.
when HTTP_REQUEST { if { [active_members My_DEV_7443_Pool ] < 1 } { HTTP::respond 503 content [ifile get 503-error-irule ] else { discard event disable TCP::close } } }
3 Replies
- KJ_50941
Nimbostratus
do I need to load image on F5? how do I refer to it from irule ?
- PeteWhite
Employee
You put a link pointing to where it's stored preferably. This may mean you need to store it somewhere first of course. You can also base64 encode the image and send that to the browser in the html of the iFile. I'll leave you to google how to do that.
- IheartF5_45022
Nacreous
A sorry page served from the F5 is usually best
- a self-contained HTML with embedded images/js OR
- can have resources served from a domain other than the domain for which you are displaying the sorry page OR
- can be a 302 redirect to a sorry page on another domain
If you wanted to serve a sorry page and someone else produces it for you and puts it on a webserver for you, you can scoop it up like this and store it as an ifile ;
curl -H "Accept-Encoding:gzip" http://10.9.8.7/sorry.html > /var/class/sorry_html tmsh create sys file ifile "sorry_html" source-path file:/var/class/sorry_html tmsh create ltm ifile "sorry_html" file-name "sorry_html"I tend to use LB_FAILED to serve a page myself as it covers all failure modes, not just when all pool members down;-
when LB_FAILED { HTTP::respond 503 -version 1.1 content [ifile get "sorry_html"] noserver Accept-Encoding "gzip" Content-Type "text/html;charset=utf-8" Retry-After "300" noserver }If you wanted to serve an image scoop it up from server like this;
tmsh create sys file ifile "myimage_png" source-path http://10.9.8.7/myimage.png tmsh create ltm ifile "myimage_png" file-name "myimage_png"then in the iRule to display the image;-
HTTP::respond 200 -version 1.1 content [ifile get "myimage_png"] noserver Content-Type "image/png" noserver
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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