OK let's GO We will begin with maintenance page:
First you have to import all your files (page, png, css, gif):
- Create your FILE: System ›› File Management ›› Import...
- then create your ifile: Local Traffic ›› iRules : iFile List ›› New iFile...
And use this simple Irule for maintenance page that trigged when you have an error 5** for example:
when HTTP_REQUEST {
--- set variable ---
set host [HTTP::host]
set uri [HTTP::uri]
set alert 0
--- set variable ---
--- Trigged maintenance for Node down ---
if {[active_members [LB::server pool]] < 1 } {
if {$uri == "/maintenance_page.html"} {
do nothing
} elseif {$uri == "/css/yourcss.css" || $uri == "/img/yourgif.gif" || $uri == "/img/yourpng.png" } {
do nothing
} else {
HTTP::redirect "https://$host/maintenance_page.html"
}
}
--- load maintenance page object ---
switch -glob [HTTP::uri] {
"/maintenance_page.html" { HTTP::respond 200 content [ifile get "/Common/maintenance_page.html"] noserver "Content-Type" "text/html" "Cache-Control" "no-cache, must-revalidate"
set alert 1}
"/css/yourcss.css" { HTTP::respond 200 content [ifile get "/Common/yourcss.css"] noserver "Content-Type" "text/css" "Cache-Control" "no-cache, must-revalidate"
set alert 1}
"/img/yourgif.gif" { HTTP::respond 200 content [ifile get "/Common/yourgif.gif"] noserver "Content-Type" "image/gif" "Cache-Control" "no-cache, must-revalidate"
set alert 1}
"/img/yourpng.png" { HTTP::respond 200 content [ifile get "/Common/yourpng.png"] noserver "Content-Type" "image/png" "Cache-Control" "no-cache, must-revalidate"
set alert 1}
default {
do nothing
}
}
}
when HTTP_RESPONSE {
--- Trigged maintenance for 500
if {[HTTP::status] starts_with "5"} {
HTTP::respond 200 content [ifile get "/Common/maintenance_page.html"] noserver "Content-Type" "text/html" "Cache-Control" "no-cache, must-revalidate"
}
}