Forum Discussion
Balasubramaniy2
Nimbostratus
Aug 29, 2018F5 migration from HA proxy
Following settings need to migrated to F5 LTM from HA proxy. kindly help to achieve the same settings in F5.
Custom Error page (HTML file) --> when following Error response getting from server ...
youssef1
Cumulonimbus
Aug 29, 2018OK 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"
}
}
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
