Advertisements

Set up a maintenance page on Netscaler Gateway

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.

  1. Create a maintenance html page (code included below)
  2. Create a Responder action which will redirect the traffic to the maintenance page.
  3. 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.
  4. Bind your Responder policy to your NetScaler Gateway vServer

Environment:

  • Citrix NetsScaler 11.0Build 63.16.nc
  • StoreFront 3.5

Lets get started:

  1. 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&rsquo;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>

01-maint

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

ns11_rw_final

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.

Advertisements

About CyberRuiz
Highly motivated with over 12 years experience on Citrix/VMWare/Microsoft/technologies. Exceptional communication skills and team player. CCIA – Citrix Certified Integration Architect. CCEA – Citrix Certified Enterprise Administrator. VCP – VMWare Certified Professional in ESX 2.x, VI3, VI4 MCSE – Microsoft Certified Systems Engineer

5 Responses to Set up a maintenance page on Netscaler Gateway

  1. Juanito says:

    That is awesome..!
    Thanks for sharing.

  2. Pingback: NetScaler Gateway 11 Virtual Server – Carl Stalhood

  3. Pingback: EUC Weekly Digest – May 7, 2016 – Carl Stalhood

  4. Pingback: NetScaler Gateway 11.1 Virtual Server – Carl Stalhood

  5. Pingback: NetScaler Gateway 12 Tweaks – Carl Stalhood

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: