Learn F5 Technologies, Get Answers & Share Community Solutions Join DevCentral

Filter by:
  • Solution
  • Technology
Answers

https redirect - maintenance page

Hello Everyone,

I am new to irules so I need some help.
We have a HTTPS Virtual Server configured on the LTM with four web servers in the pool. The certificate is installed on the F5 (SSL Client profile). We have a requirement to redirect users to a maintenance page when all the web servers are down (web servers are monitored using a monitor at the pool level). I was looking at irules to accomplish this.
Looking around the forum's I found a link to an irule " http://devcentral.f5.com/wiki/default.aspx/iRules/HTTPS_passthrough_fallback_URL.html" which is exactly what I am trying to achieve

To test it, I applied the irule to the Virtual server and manually disabled all the servers in the pool. As expected the web requests were redirected to the maintenance website. However when I enabled one of the web servers and tried to access the website it does not come up, it just shows me a blank screen with a status saying its trying to connect...

Am i missing something?

Any help is greatly appreciated

Thanks.
0
Rate this Question

Answers to this Question

placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER
That rule appears to let the pool members do the decryption unless they're down in which case LTM will do the decryption and then send the user to the maintenance page.

It sounds like you're simply trying to redirect users to the maint page if the pool members are down. Is that correct?
0
placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER
How about something like this?


when HTTP_REQUEST {
    if {  [active_members poolx] < 1 } {
         HTTP::redirect "http://www.example.com/maintenance.html" }
    }


Otherwise, you could use the "Fallback Host" option from an HTTP Profile. That's usually the easiest option.
0
placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER
Thanks Cris, Yes I realised it later that the iRule was passing SSL thru to the nodes. I am using the below irule now, which seems to work fine

when HTTP_REQUEST {

if { [active_members [LB::server pool]] <1 } {

HTTP::redirect "http://maintenance.page.com"
TCP::close
}
}




0
placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER
I will look into the fallback host option. Thanks again!
0
placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER
That iRule was designed to only decrypt the SSL if no pool members were available. To get the functionality you're looking for, you should be able to use the fallback host field on an HTTP profile without an iRule.

Aaron
0