Set up a maintenance page on Netscaler Gateway
May 5, 2016 6 Comments
From time to time there may be a need to bring your remote access down due to scheduled maintenance. Sure all sorts of communication will be sent out, but the cold fact is that users don’t read or remember 😛
Below are the steps on how to manually display a maintenance page on your NetScaler Gateway to inform that the site is down.
- Create a maintenance html page (code included below)
- Create a Responder action which will redirect the traffic to the maintenance page.
- Create a Responder policy to only be used when the traffic contains a specific fqdn (ex: remote.company.com) as well as specific index.html file.
- Bind your Responder policy to your NetScaler Gateway vServer
Environment:
- Citrix NetsScaler 11.0Build 63.16.nc
- StoreFront 3.5
Lets get started:
- Create your maintenance.html page and upload to the Netscaler, in my case I am using a very customized theme and uploaded to /var/netscaler/logon/themes/nameoftheme/custom_media
<!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>
<h1>We’ll be back soon!</h1>Sorry for the inconvenience but we’re performing maintenance between the hours of midnight to 4 am. If you need to you can always contact us, otherwise we’ll be back online shortly!
— Information Technology Support Center
</article>
2. Create a Responder action to redirect to your new maintenance.html file
add responder action ns_gateway_maint_action redirect “\”https://remote.company.com/logon/themes/Default/custom_media/maintenance.html\”” -responseStatusCode 302
3. Create a Responder policy and assign the action from step 2. In my case, I am hosting several sites on a single gateway, so I needed to specify the hostname header and index.html file of my NetScaler Gateway site 😛
add responder policy ns_gateway_maint_policy “HTTP.REQ.HOSTNAME.EQ(\”remote.company.com\”) && HTTP.REQ.URL.CONTAINS(\”index.html\”)” ns_gateway_maint_action
4. Bind your new responder policy to your NetScaler Gateway site
bind vpn vserver external_portal -policy ns_gateway_maint_policy -priority 100 -gotoPriorityExpression END -type REQUEST
Next time your users go to your Gateway, in my case https://remote.company.com, they will all be redirected to the maintenance page, once work is done, you can unbind the policy and users will again be redirected to your Gateway main page.
unbind vpn vserver internal_portal -policy ns_gateway_maint_policy
Hope this helps 🙂
Disclaimer:
I do not accept any responsibility or liability for the accuracy, content, completeness, legality, or reliability of the information contained on this website.
That is awesome..!
Thanks for sharing.
Pingback: NetScaler Gateway 11 Virtual Server – Carl Stalhood
Pingback: EUC Weekly Digest – May 7, 2016 – Carl Stalhood
Pingback: NetScaler Gateway 11.1 Virtual Server – Carl Stalhood
Pingback: NetScaler Gateway 12 Tweaks – Carl Stalhood
Pingback: Citrix Gateway Tweaks – Carl Stalhood