Forum Discussion

Chris_Chaloux_1's avatar
Chris_Chaloux_1
Icon for Nimbostratus rankNimbostratus
Dec 03, 2008

LTM 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/default.aspx/iRules/LTMMaintenancePage.html).

The issue I am having is that instead of the lindex html stream being returned, it is returning the location of the class file to the browser. When I invoke the rule by going after the VIP from my browser, the only display I get is:

/var/class/maint.index.html.class

Thats it! It seems like either a variable isnt being invoked correctly, or for some reason it is interpreting the call to the class file as a literal.

My iRule reads like this:

  
  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  
        
      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}/"  
         return  
      }  
      if { $uri starts_with "${::maint_prefix}/" } {  
          trim off the maintenance prefix  
         set uri [string range $uri $::maint_len end]  
           
          Return the requested page  
  log local0. "respond: [lindex $::maint_index_html 0]"  
  switch $uri {  
           "/"              -  
           "/index.html"   { HTTP::respond 200 content [lindex $::maint_index_html 0]           "Content-Type" "text/html" }  
           "/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"  
        return  
      }  
    }  
  

Does anyone see whats going on? This is driving me nuts!!

Thanks,

Chris

15 Replies