Updated on 2022-01-25 GMT+08:00

HTTP Redirection to HTTPS

Scenarios

HTTPS is an extension of HTTP. HTTPS encrypts data between a web server and a browser. Redirection allows requests to be redirected from HTTP to HTTPS.

After redirection is enabled, all HTTP requests to access your website are transmitted over HTTPS connections to improve service security.

Prerequisites

  • An HTTPS listener has been added.
  • An HTTP listener has been added.

Create a Redirect

  1. Log in to the management console.
  2. In the upper left corner of the page, click and select the desired region and project.
  3. Click Service List. Under Network, click Elastic Load Balance.
  4. Locate the target load balancer and click its name.
  5. Click Listeners, locate the target HTTP listener, and click its name.
  6. Click Redirects and then Create on the right.
    Table 1 Parameters for configuring redirection

    Parameter

    Description

    Example Value

    Name

    Specifies the redirect name.

    redirect-g8h9

    Redirected To

    Specifies the HTTPS listener to which requests are redirected.

    N/A

    Description

    Provides supplementary information about the redirect.

    N/A

  7. Click OK.
    • If requests to an HTTP listener are redirected, its configuration becomes invalid except for access control.
    • After an HTTP listener is redirected, backend servers return HTTP 301 Move Permanently to the clients.

Modify a Redirect

  1. Log in to the management console.
  2. In the upper left corner of the page, click and select the desired region and project.
  3. Click Service List. Under Network, click Elastic Load Balance.
  4. Locate the target load balancer and click its name.
  5. Click Listeners, locate the target HTTP listener, and click its name.
  6. Click Redirects, locate the target redirect, and click Modify in the Operation column.
  7. In the Modify Redirect dialog box, modify the redirect name or description, or select another listener, and click OK.

Delete a Redirect

  1. Log in to the management console.
  2. In the upper left corner of the page, click and select the desired region and project.
  3. Click Service List. Under Network, click Elastic Load Balance.
  4. Locate the target load balancer and click its name.
  5. Click Listeners, locate the target listener, and click its name.
  6. Click Redirects, locate the target redirect, and click Delete in the Operation column.
  7. In the Delete Redirect dialog box, click Yes.