Forum Discussion
Maintenance iRule Question
I've read several posts on creating an iRule that addresses Maintenance for pools of servers. So I'm pretty much sorted when it comes to creating the iRule to redirect traffic to another server in the event all pool members are down. However, when I do the redirect the redirected server's DNS is displayed in the user's browser window.
I can't seem to figure out how to have the LTM mask the maintenance server's DNS with the originally requested site. So that when user's receive the down message, they can just refresh the site when the pool members become available again.
Could someone give me a point in the right direction on how to craft this iRule? Thanks for your time.
when HTTP_REQUEST {
if { [active_members [LB::server pool]] == 0} {
HTTP::redirect "http://maintenance.server" }
}
- natheCirrocumulus
Guy, yes a redirect will change the browser bar.
Try this line instead:
HTTP::header replace Host "maintenance.server"
See if that works as you'd hope.
Rgds N
- Guy_Goodenough_Nimbostratus
Unfortunately, this doesn't seem to work for me. When I replace the code, the traffic is no longer redirected and the client receives a "connection was reset" error.
- natheCirrocumulus
I wonder if you need to add a second line to blank out any URI the user is inputting.
HTTP::uri /
See if that sorts.
N
- Guy_Goodenough_Nimbostratus
I receive the same error. However, I may not implementing the code correctly.
when HTTP_REQUEST { if { [active_members [LB::server pool]] == 0} { HTTP::header replace Host "http://maintenance.server" HTTP::uri / } }
- Kevin_StewartEmployee
Is the maintenance content on a different server? If so you'll also need to provide some command to tell it where to send the traffic.
when HTTP_REQUEST { if { [active_members [LB::server pool]] < 1 } { pool maint_pool HTTP::uri "/" HTTP:: header replace Host "maintenance.server" } }
- Guy_Goodenough_Nimbostratus
That did the trick. Thanks so much for the help!
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