How to Configure a 301 Move Permanent HTTP to HTTPS Redirect for a Load Balancing Virtual Server on a NetScaler Appliance

How to Configure a 301 Move Permanent HTTP to HTTPS Redirect for a Load Balancing Virtual Server on a NetScaler Appliance

book

Article ID: CTX133383

calendar_today

Updated On:

Description

This article describes how to configure the NetScaler appliance to redirect network traffic from a HTTP to HTTPS virtual IP address. It also describes how to configure the HTTP/80 load balancing virtual IP address to result in a 301 Permanent Redirect.

Background

To set up a HTTP to HTTPS redirect, create an HTTP/80 load balancing virtual IP address, disable it, and configure the Redirect URL to the HTTPS web page. However, this results in a 302 Temporary Redirect.


Instructions

To configure the NetScaler appliance to redirect network traffic from a HTTP to HTTPS virtual IP address, complete the following procedure:

  1. Ensure that the status of the HTTP/80 load balancing virtual server is set as UP, and is bound to the correct service.

  2. Create a responder action with Respond With type and with the following Target:
    "HTTP/1.1 301 Moved Permanently\r\n" + "Location: https://domain.com" + "\r\n\r\n"
    Note: If you want to retain the path and query, configure with the following Target:
    "HTTP/1.1 301 Moved Permanently\r\n" + "Location: https://domain.com" + http.req.url.path_and_query.http_url_safe + "\r\n\r\n"

    Alternately, create a responder Action with Redirect type and the following Target :

    User-added image

  3. Create a responder policy with an expression HTTP.REQ.URL.CONTAINS("/") and bind the responder action to it.

    User-added image

  4. Bind the responder policy to the specific HTTP/80 load balancing virtual server.
    Note: When you run a header trace, you should see the HTTP/1.1 301 Moved Permanently message, as shown in the following screen shot. 

    User-added image

Issue/Introduction

This article describes how to configure the NetScaler appliance to redirect network traffic from a HTTP to HTTPS virtual IP address.