Hi Aaron,
I do b class list all
below is the result:
class maint_index_html_class {
type string
timestamp 2010-11-23 09:36:52
filename "/var/class/maint.index.html.class"
mode rw
separator ":="
partition Common
"Maintenance page
Sorry! This site is down for maintenance."
}
class maint_logo_png_class {
type string
timestamp 2010-11-23 15:23:48
filename "/var/class/maint.logo.png.class"
mode rw
separator ":="
partition Common
{
" "
"iVBORw0KGgoAAAANSUhEUgAAAL4AAAC3AgMAAADRFQzGAAAACVBMVEUAAADDAAD///8UoaPIAAElFTkSuQmCC"SLUHbWwzRlvrS1spJalnVcanB9Evvj8aLuZ3BX1Y1P+AUbgLzbWCp20NpfmAAAA
}
}
anything wrong in the class?
the irules as below:
when HTTP_REQUEST {
Service requests for files (URIs) from the maintenance page.
Note that we always service these pages, even if the http_pool is up.
The maintenance prefix should be unique in the application and
not conflict with an existing directory on the web servers.
set maint_prefix "/maintenancepage"
if { [HTTP::uri] starts_with "$maint_prefix" } {
Strip off the $maint_prefix from the URI as you can't easily do variable expansion
within a switch statement.
Note that requests for the exact maintenance prefix URI will be set to a null string,
so handle null in the first switch case.
set uri [string map [list $maint_prefix ""] [HTTP::uri]]
Return the requested page based on the requested URI
switch -- $uri {
"" {
log local0. "Request for $maint_prefix. Redirecting to $maint_prefix/"
HTTP::redirect "$maint_prefix/index.html"
}
"/" -
"/index.html" {
log local0. "Request for index. Responding with content: [lindex $::maint_index_html_class 0]"
HTTP::respond 200 content [lindex $::maint_index_html_class 0] "Content-Type" "text/html"
}
"/logo.png" {
log local0. "Request for logo.png. Responding with binary content"
HTTP::respond 200 content [b64decode [lindex $::maint_logo_png_class 0]] "Content-Type" "image/png"
}
default {
log local0. "Unrecognized request to URI: [HTTP::uri]"
HTTP::respond 404 content "Unrecognized request to [HTTP::uri]" "Content-Type" "text/html"
}
}
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"
}
}