Forum Discussion
how to display maintenance banner via LTM policy
Hi Bhupendra
Hope you are doing well.
You coudl do it via iRule redirection to a sorry page OR you could provide it directly after matching your conditions as requested above.
SOL1#
--------------------------------------
when HTTP_REQUEST {
#create a data group adding allowed_ip_addresses to assign it here in iRule
if { ([HTTP::uri] starts_with "/example") && (![class match [IP::client_addr] equals allowed_ip_addresses]) } {
HTTP::redirect "http://www.corp_xyz.com/sorry_page.html
log local0. "Client IP : [IP::client_addr] ==> sorrypage"
}
}
SOL#2
-----------------------
when HTTP_REQUEST {
#make sure to create a data group adding allowed_ip_addresses to assign it here in iRule
if { ([HTTP::uri] starts_with "/example") && (![class match [IP::client_addr] equals allowed_ip_addresses]) } {
HTTP::respond 200 content {
<html>
<head>
<title>Apology Page</title>
</head>
<body>
We are sorry, but the site you are looking for is temporarily out of service<br>
If you feel you have reached this page in error, please try again.
</body>
</html>
}
}
}
Hi , Thanks for your response.
I have both irule and LTM policy on same vip.
LTM policy rule -------->
HTTP URI full string starts with '/example' at request time.
Forward traffic to POOL A
---------------------------------------------------------------------------------
Banner rule----->
when HTTP_REQUEST {
if { ([HTTP::uri] starts_with "/example")
HTTP::respond 200 content {
<html>
<head>
<title>Apology Page</title>
</head>
<body>
We are sorry, but the site you are looking for is temporarily out of service<br>
If you feel you have reached this page in error, please try again.
</body>
</html>
}
}
}
I tried to put simple messgae on banner. It is not working. Always says site can not be reached. connection reset message .I can see execution hits on irule without error. Also LTM logs i can see irule executed.
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