Forum Discussion
Chris_Chaloux_1
Nimbostratus
Dec 03, 2008LTM Maint. Page issue
All -
I am trying to set up the LTM Maintenace Page example and I'm running into an issue. I have set up the rule exactly as described in the document (http://devcentral.f5.com/Wiki/defa...
hoolio
Cirrostratus
Dec 04, 2008What is your class name that contains the HTML? Is it named exactly maint_index_html? If so you can reference it using $::maint_index_html. Can you try this rule and see if it works for you?
when HTTP_REQUEST {
Test the maint_index_html class
if {[info exists ::maint_index_html]}{
log local0. "\[lindex \$::maint_index_html 0\]: [lindex $::maint_index_html 0]"
} else {
log local0. "\$::maint_index_html doesn't exist!"
}
Service requests for files (URIs) from the maintenance page
Note that we always service these pages, even if the http_pool is up
set maint_prefix "/maintenancepage"
set maint_len [string length $maint_prefix]
set uri [HTTP::uri]
log local0. "redirect: [HTTP::uri]"
if { $uri equals $maint_prefix } {
HTTP::respond 301 "Location" "$maint_prefix/"
} elseif { $uri starts_with "$maint_prefix/" } {
Return the requested page
switch $uri {
"$maint_prefix/" -
"$maint_prefix/index.html" {
HTTP::respond 200 content [lindex $::maint_index_html 0] "Content-Type" "text/html"
}
"$maint_prefix/logo.png" {
HTTP::respond 200 content [b64decode [lindex $::maint_logo_png 0]] "Content-Type" "image/png"
}
default {
HTTP::respond 404
}
}
return
}
If the all members in the default pool are down, redirect to the maintenance page
if { [active_members [LB::server pool]] < 1 } {
HTTP::redirect "$maint_prefix/index.html"
}
}
If not, can you check the /var/log/ltm file for any errors or debug?
Thanks,
Aaron
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
