Forum Discussion
Martin_Williams
Nimbostratus
Jul 01, 2015Maintenance Page using multiple ifiles
Hi,
I am trying to set up an irule maintenance page using ifiles but am having difficulty getting the images to work. I need to have different pages for different domains e.g
when LB_FAILE...
THi
Nimbostratus
Jul 01, 2015The images cause a new http get request, therefore you do not see them in the response created by the LB_FAILED event.
Either catch the image request and respond separately in HTTP_REQUEST event...
set css xxx-css
set logo xxx-logo
...
switch [HTTP::uri] {
"/xxx.css" {
HTTP::respond 200 content [ifile get $css] "Content-Type" "text/css; charset=utf-8"
}
"/xxx.png" {
HTTP::respond 200 content [ifile get $logo] "Content-Type" "image/png"
}
}Also try adding Content-Type image/png header. The code works with us (11.5.1 sw). We put the iFile names into variables as they were needed elsewhere in the iRule logic.
... or you do it inline in the LB_FAILED by b64 encoding into response html, something like:
set img [b64encode [ifile get $logo]]
...
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects
