Forum Discussion
IRULE for Maintenance page
For my client there is 3 Portal behind virtual server. Whenever client manually down any of the portal , that portal generate error 500. Other 2 portal works fine at the same time.I am looking to iRule which generate specific iFile for specific portal returning error 500.
Portal are :
https://stibo-portalv.kfplc.com/portal/sfxsupplier
https://stibo-portalv.kfplc.com/portal/sfxuser
https://stibo-portalv.kfplc.com/portal/sfxphotographer
Existing iRule need to modified :
when HTTP_REQUEST {
set hostvar [HTTP::host]
set urivar [HTTP::uri]
set VSPool [LB::server pool]
if {([active_members $VSPool] < 1) && !([HTTP::uri] starts_with "/portal/sfx") } {
HTTP::respond 200 content [ifile get stibo_all_opco]
}
if {([active_members $VSPool] < 1) && ([HTTP::uri] starts_with "/portal/sfx") } {
HTTP::respond 200 content [ifile get stibo_SFX]
}
}
My Modification no working is :
when HTTP_REQUEST {
set hostvar [HTTP::host]
set urivar [HTTP::uri]
set VSPool [LB::server pool]
if {([active_members $VSPool] < 1) && !([HTTP::uri] starts_with "/portal/sfx") } {
set check_response 0
HTTP::respond 200 content [ifile get stibo_all_opco]
}
if {([active_members $VSPool] < 1) && ([HTTP::uri] starts_with "/portal/sfx") } {
set check_response 1
}
} when HTTP_RESPONSE {
if {($check_response==1) && ([HTTP::status] == 500) }{
HTTP::respond 200 content [ifile get stibo_SFX]
}
}
3 Replies
- Stanislas_Piro2
Cumulonimbus
Hi,
can you test this irule:
when HTTP_REQUEST { if {([HTTP::uri] starts_with "/portal/sfx")} { set responsepage [ifile get stibo_SFX] } else { set responsepage [ifile get stibo_all_opco] } if {([active_members [LB::server pool]] < 1) } { HTTP::respond 200 content $responsepage } } } when HTTP_RESPONSE { if {[info exists responsepage] && ([HTTP::status] == 500) }{ HTTP::respond 200 content $responsepage } } - SP_SINGH_279526
Nimbostratus
Great!!!!. It is working .
Thank you so much for helping me on iRULE.
Hi SP_SINGH,
please flag Stanislas answer with the "Accept this answer" functionality. This will help other devcentral users to identify already solved questions. ;-)
Thanks and Cheers, Kai
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
