How to Configure a Maintenance Web Page by Using the Responder Feature of NetScaler

How to Configure a Maintenance Web Page by Using the Responder Feature of NetScaler

book

Article ID: CTX117337

calendar_today

Updated On:

Description

This article describes how to configure a maintenance web page by using the Responder feature of the NetScaler appliance.

Background

At times, when the services for a website are not available because of a planned outage or an unexpected event, you might want to display a maintenance or an apology page to the customer. You can use the Responder feature of the NetScaler appliance to create such a notification page during these events.

To learn more about the Responder feature, refer to Citrix Documentation - Responder.


Instructions

To configure a maintenance webpage by using the Responder feature of the NetScaler appliance, complete the following procedure:

  1. If not already done, run the following command to configure the required services:
    add service server1 <IP_Address_of_Service> HTTP 80

    You have to create a service that is always UP and bind it to this backup virtual server so that it will always remain UP. Go to Load Balancing > Services, and click Add and then create a service called "always-up" and use any dummy IP for the server and add a ping monitor, and click Create.

    Alternately you can also make the monitor as type Reverse so that even if the service is down it will be always up for the dummy IP.

    User-added image

  2. Run the following command to configure a Load Balancing virtual server:
    add lb vserver vserver1 HTTP <IP_Address_of_VServer> 80

  3. Run the following command to configure a backup Load Balancing virtual server:
    add lb vserver backup HTTP 0.0.0.0 0

  4. Run the following command to bind a service to the backup virtual server to ensure that the status of the backup virtual server is marked as UP:
    bind lb vserver backup always-up

  5. Run the following command to configure the main virtual server with the backup virtual server:
    set lb vserver vserver1 -backupVServer backup

  6. Run the following command to create a Responder action with an appropriate target web page:
    add responder action mtn_pg_act respondwith q{"HTTP/1.0 200 OK" +"\r\n\r\n" + "<html><body>Sorry, this page is currently not available. Please try after some time.</body></html>" + "\r\n"}

    Note: To avoid caching of the maintenance web page, you can set the HTTP code to 503 Service Unavailable instead of 200 OK.

  7. Run the following command to create a Responder policy:
    add responder policy sorryPol HTTP.REQ.IS_VALID mtn_pg_act

  8. Run the following command to bind the policy to the backup virtual server:
    bind lb vserver backup -policyName sorryPol -priority 4

Environment

The above mentioned sample code is provided to you as is with no representations, warranties or conditions of any kind. You may use, modify and distribute it at your own risk. CITRIX DISCLAIMS ALL WARRANTIES WHATSOEVER, EXPRESS, IMPLIED, WRITTEN, ORAL OR STATUTORY, INCLUDING WITHOUT LIMITATION WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NONINFRINGEMENT. Without limiting the generality of the foregoing, you acknowledge and agree that (a) the sample code may exhibit errors, design flaws or other problems, possibly resulting in loss of data or damage to property; (b) it may not be possible to make the sample code fully functional; and (c) Citrix may, without notice or liability to you, cease to make available the current version and/or any future versions of the sample code. In no event should the code be used to support ultra-hazardous activities, including but not limited to life support or blasting activities. NEITHER CITRIX NOR ITS AFFILIATES OR AGENTS WILL BE LIABLE, UNDER BREACH OF CONTRACT OR ANY OTHER THEORY OF LIABILITY, FOR ANY DAMAGES WHATSOEVER ARISING FROM USE OF THE SAMPLE CODE, INCLUDING WITHOUT LIMITATION DIRECT, SPECIAL, INCIDENTAL, PUNITIVE, CONSEQUENTIAL OR OTHER DAMAGES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. Although the copyright in the code belongs to Citrix, any distribution of the sample code should include only your own standard copyright attribution, and not that of Citrix. You agree to indemnify and defend Citrix against any and all claims arising from your use, modification or distribution of the sample code.

Issue/Introduction

This article describes how to configure a maintenance web page by using the Responder feature of the NetScaler appliance.

Additional Information

Citrix Documentation - Troubleshooting Responder Issues