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]
}
}