Contents

Configure a Maintenance Page on NetScaler IMP

A Quick Guide to Setting Up Responder Policies in NetScaler

Website Visitors:

In this guide, we will set up a maintenance page using a responder policy on NetScaler. We’ll cover both the Graphical User Interface (GUI) and the Command Line Interface (CLI) for creating a responder action, responder policy, and binding it to a load balancing virtual server (vServer). Additionally, we will create a custom HTML page for the maintenance message, upload it to the NetScaler, and use it in the responder action.

Step 1: Create a Custom HTML Page

Before configuring the responder action, we need a custom HTML page that will display the maintenance message. You can design your own maintenance page with custom text, styling, and images. Here’s a basic example:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Maintenance in Progress</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            text-align: center;
            background-color: #f2f2f2;
            padding: 50px;
        }
        .container {
            background-color: white;
            padding: 40px;
            margin: 0 auto;
            max-width: 600px;
            border-radius: 10px;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
        }
        img {
            width: 150px;
            margin-bottom: 20px;
        }
        h1 {
            color: #FF6600;
        }
        p {
            font-size: 18px;
        }
    </style>
</head>
<body>
    <div class="container">
        <img src="your-image-url-here" alt="Maintenance Icon">
        <h1>We'll be right back!</h1>
        <p>Our website is currently down for scheduled maintenance.<br>We expect to be back shortly. Thank you for your patience!</p>
    </div>
</body>
</html>
  • Replace the your-image-url-here with the URL of any custom image you’d like to display.
  • Save this file as Maintenance_Window_HTMLPage.html.

Step 2: Upload the HTML Page to NetScaler

  1. Log in to the NetScaler GUI.

  2. Navigate to AppExpertResponderHTML Page Imports.

  3. Click Add and Enter a Name (Maintenance_Window_HTMLPage), Select “File” option under “Import From” option. Under “Local File” option browse to the html file you created earlier.

  4. The HTML page is now uploaded to the NetScaler and can be used in the responder action.

Step 3. Create the Responder Action

Using GUI:
  1. After importing the HTML file, go to AppExpertResponderActions.
  2. Click on the Add button to create a new responder action.
  3. Enter "Maintenance Window Action" in the Name field.
  4. Choose Respond with HTML Page as the Action Type.
  5. In the HTML Page field, select the page you imported earlier (Maintenance_Window_HTMLPage).
  6. Set HTTP Status Code to 503 (Service Unavailable).
  7. Click Create.
Using CLI:

Run the following command to create the responder action:

1
add responder action "Maintenance Window Action" respondwithhtmlpage Maintenance_Window_HTMLPage -responseStatusCode 503

This creates a responder action that serves the custom maintenance HTML page with the HTTP status code 503 (Service Unavailable).

Step 4. Create the Responder Policy

Using GUI:
  1. Go to AppExpertResponderPolicies.
  2. Click on the Add button to create a new responder policy.
  3. Enter "Maintenance Window Policy" in the Name field.
  4. Under Action, choose the responder action you created earlier (Maintenance Window Action).
  5. Under Expression, use SYS.TIME.WITHIN(GMT 2024 OCT 07 13h 05m,GMT 2024 OCT 07 13h 15m). Change this to the time as you need. This is in GMT format.
  6. Click Create.
Using CLI:

Run the following command to create the responder policy:

1
add responder policy "Maintenance Window Policy" "SYS.TIME.WITHIN(GMT 2024 OCT 07 13h 05m,GMT 2024 OCT 07 13h 15m)" "Maintenance Window Action"

This command creates a policy that triggers the Maintenance Window Action during the specified time window.

Step 5. Bind the Responder Policy to a Load Balancing vServer or Citrix Gateway

Using GUI:
  1. Navigate to Traffic ManagementLoad BalancingVirtual Servers.
  2. Select the virtual server (vServer) you want to apply the policy to (e.g., "WebServer LB").
  3. Click on Policies under the vServer’s settings.
  4. Choose Responder from the drop-down and type as Request.
  5. Select "Maintenance Window Policy" from the list of policies.
  6. Set Priority to 100.
  7. Click Bind.
Using CLI:

Run the following command to bind the policy to the load balancing virtual server:

1
bind lb vserver "WebServer LB" -policyName "Maintenance Window Policy" -priority 100 -gotoPriorityExpression END -type REQUEST

This binds the responder policy to the WebServer LB virtual server with a priority of 100.

Final Notes

  • The responder policy will automatically activate during the specified time window, serving the maintenance page to users.
  • After the time window elapses, users will no longer see the maintenance page.

With this setup, your NetScaler will effectively handle planned maintenance, presenting a custom message and maintaining a professional experience for users during downtime.

Want to learn more on Citrix Automations and solutions???

Subscribe to get our latest content by email.

If you like our content, please support us by sponsoring on GitHub below: