HTTP Redirection to HTTPS

Scenarios

HTTPS is an extension of HTTP. HTTPS encrypts data between a web server and a browser.

If you enable redirection, all HTTP requests to your website are transmitted over HTTPS connections to improve security.

  • If the listener's protocol is HTTP, only the GET or HEAD method can be used for redirection. If you create a redirect for an HTTP listener, the client browser will change POST or other methods to GET. If you want to use other methods except GET and HEAD, add an HTTPS listener.
  • HTTP requests are forwarded to the HTTPS listener as HTTPS requests, which are then routed to backend servers over HTTP.
  • If an HTTP listener is redirected to an HTTPS listener, no certificate will be deployed on the backend servers associated with the HTTPS listener. If certificates are deployed, HTTPS requests will not take effect.

Prerequisites

Constraints and Limitations

Creating 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. Hover on in the upper left corner to display Service List and choose Network > Elastic Load Balancing.
  4. Locate the load balancer and click its name.
  5. Click Listeners, locate the HTTP listener, and click its name.
  6. Click Redirects and then click Create in the right pane.
    Table 1 Parameter description

    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 you create a redirect for an HTTP listener, its settings will not take effect except access control.
    • If you create a redirect for an HTTP listener, the load balancer will return HTTP 301 Move Permanently to the clients.

Modifying 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. Hover on in the upper left corner to display Service List and choose Network > Elastic Load Balancing.
  4. Locate the load balancer and click its name.
  5. Click Listeners, locate the HTTP listener, and click its name.
  6. Click Redirects, locate the redirect, and click Modify in the Operation column.
  7. In the Modify Redirect dialog box, modify the redirect name or description, or select another HTTPS listener, and click OK.

Deleting 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. Hover on in the upper left corner to display Service List and choose Network > Elastic Load Balancing.
  4. Locate the load balancer and click its name.
  5. Click Listeners, locate the listener, and click its name.
  6. Click Redirects, locate the redirect, and click Delete in the Operation column.
  7. In the Delete Redirect dialog box, click Yes.