Forum Discussion
kgaigl
Cirrocumulus
Aug 14, 2019IRule Maintenance Page only from outside
Hi, I've got an IRule with a static Maint-Page: when HTTP_REQUEST {
if { [active_members [LB::server pool]] < 1 } {
switch [HTTP::uri] {
"/mylogo.png" {HTTP::respond 20...
Lee_Sutcliffe
Nacreous
Aug 14, 2019You can try this combination, it will not display the content if the source IP address is defined in your data group.
Notice the 'not' (!) in the if statement used in the default section of the switch.
when HTTP_REQUEST {
if {[active_members [LB::server pool]] < 1 } {
switch [HTTP::uri] {
"/mylogo.png" {
HTTP::respond 200 content [ifile get "mylogo.png"]
}
default {
if {!([class match [IP::addr [IP::client_addr]] equals "private_net"])} {
HTTP::respond 200 content {
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
<article>
<img src="/mylogo.png" />
<h1>Wir sind bald wieder für Sie da!</h1>
<div>
<p>Bitte entschuldigen Sie die Unannehmlichkeiten, aber wir führen auf dieser Seite gerade Wartungsarbeiten durch.</p>
<p>Sie können uns jederzeit <a href="mailto:IV-ServiceDesk@versorgungskammer.de">kontaktieren</a>, wir sind aber in Kürze wieder online.</p>
<p>Ihre Informationsverarbeitung</p>
</div>
</article>
}
}
}
}
}
}
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects