Forum Discussion

rschwarz79's avatar
rschwarz79
Icon for Nimbostratus rankNimbostratus
Jun 13, 2024

LB_FAILED test event

Hello Folks,

 

Can someone tell/help me to test the LB_FAILED event? Background is I want to create a Sorry/Maintenance Page on my VS.

 

Simple iRule snippet:

when HTTP_REQUEST {
  
    if { [active_members [LB::server pool]] < 1 } {
               
        switch [HTTP::path] {
            "/MaintenancePage.png" { HTTP::respond 503 content [ifile get "MaintenancePage.png"] "Content-Type" "image/png" }
            default { HTTP::respond 503 content [ifile get "MaintenancePage.html"] "Content-Type" "text/html" noserver "Connection" "close" }
        }
        
    }
        
}



when LB_FAILED {

    switch [HTTP::path] {
        "/MaintencePage.png" { HTTP::respond 504 content [ifile get "MaintencePage.png"] "Content-Type" "image/png" }
        default { HTTP::respond 504 content [ifile get "LBFailedPage.html"] "Content-Type" "text/html" }
    }   


}

 

I am not sure if the same syntax from HTTP_REQUEST is also working in LB_FAILED event. Is there any simple way to test this event or isn't possible in a working environment? 

 

Thanks & Best regards

René

No RepliesBe the first to reply