Forum Discussion
F5 Lite Maintenance Page iRule works on Virtual Servers except when the Virtual Server is Listening on 443 (HTTPS)
Hello
I'm not a programmer and so I'm no too good with iRules but, here is my issue. Any help would be great. I want a simple message (no images or anything) to be displayed when 0 pool members are available in a pool. Currently I have two Virtual Servers I am trying to apply the below iRule to. One Virtual Server is listening on all ports and the iRule is working as expected. The other is listening on 443 (HTTPS) AND is doing SSL Off loading but, does NOT display the maintenance page when there are 0 pool members available. The iRule statistics show the iRule is being executed without error but the site just hangs eventually throwing up a error that the webpage cannot be displayed. The iRule is the same on both farms with the only difference being the name of the pool its using to check if there are available members. Any help is appreciated. Again I'm just looking to display a white page with a informational sentence. Nothing Fancy.
when HTTP_REQUEST {
sets the timer to return client to host URL
set stime 10
Use the Host header value for the responses if it's set. If not, use the VIP address.
if {[string length [HTTP::host]]}{
set host [HTTP::host]
} else {
set host [IP::local_addr]
}
Check if the URI is /maintenance
switch [HTTP::uri] {
"/maintenance" {
Send an HTTP 200 response with a Javascript meta-refresh pointing to the host using a refresh time
HTTP::respond 200 content \
"Maintenance page \
We are sorry! This page is currently under maintenance and should be available as soon as our work is complete. Sorry for any inconvenience." "Content-Type" "text/html"
return } } If the pool is down, redirect to the maintenance page if { [active_members ] < 1 } { HTTP::redirect "http://$host/maintenance" return } }3 Replies
- bobbyd1282_1424
Nimbostratus
when HTTP_REQUEST {
sets the timer to return client to host URL set stime 10 Use the Host header value for the responses if it's set. If not, use the VIP address. if {[string length [HTTP::host]]}{ set host [HTTP::host] } else { set host [IP::local_addr] } Check if the URI is /maintenance switch [HTTP::uri] { "/maintenance" { Send an HTTP 200 response with a Javascript meta-refresh pointing to the host using a refresh time HTTP::respond 200 content \"Maintenance page \
We are sorry! This page is currently under maintenance and should be available as soon as our work is complete. Sorry for any inconvenience." "Content-Type" "text/html"
return } } If the pool is down, redirect to the maintenance page if { [active_members ] < 1 } { HTTP::redirect "http://$host/maintenance" return } } - bobbyd1282_1424
Nimbostratus
Sorry . This keeps applyint the html code in my iRule Im trying to have someone help me with. Here is the link to the iRule i am using found here on dev central
https://devcentral.f5.com/wiki/iRules.LTMMaintenancePageLite.ashx
- Kevin_Stewart
Employee
If you don't need images, then it's probably easier to ignore the URI inspection code and just look at active_members:
when CLIENT_ACCEPTED { set default_pool [LB::server pool] } when HTTP_REQUEST { if { [active_members $default_pool] < 1 } { HTTP::respond 200 content "...your html code here..." } }
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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