Forum Discussion
How to configure a i-rule with image (company logo) on it
HI all,
Need help to create a i-rule for maintenance page with image that should come whenever the website is down.
We do have maintenance page configured but w/o image. Please find the same & suggestions please.
::
If the all members in the default pool are down, redirect to the maintenance page
when LB_FAILED { if { [active_members [LB::server pool ]] <1 } {
HTTP::respond 200 content { Website Under Maintenance
Down For Maintenance
"We sincerely apologize for the inconvenience.Our Site is currently undergoing scheduled maintenance and upgrades,but will return shortly.Thank you for your patience." xyz.com.
}
}
} ::
Thanks in advance.
2 Replies
- Michael_Jenkins
Cirrostratus
If you have APM, you could use Hosted Files.
If not, I see that you're referencing a CSS file. Could you host the image in the same folder as the CSS file (unless the css file isn't working either). Otherwise, you could consider embedding the image in the response content using the data uri scheme. You can convert an image to its PNG data with a site like this one.
- Stefan_Klotz
Cumulonimbus
What about this?
when HTTP_REQUEST { if { [active_members ] < 1 } { switch [string tolower [HTTP::uri]] { "/maintenance/logo.gif" { HTTP::respond 200 content [b64decode "Base64 decoded Image string"] "Content-Type" "image/gif" } "/maintenance/index.html" { HTTP::respond 200 content "html-code of the sorrypage (escape all ")" } default { HTTP::redirect "https://[HTTP::host]/maintenance/index.html" } } } elseif { [string tolower [HTTP::uri]] eq "/maintenance/index.html" } { HTTP::redirect "https://[HTTP::host]" } }If you are using external CSS or even JavaScript files, we prefer to include everything in a single HTML-file. For the image you can also use something like this:
Hope that helps you and/or point you in the right direction.
Ciao Stefan 🙂
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