Configuring Layer-7 Redirection

Last Updated At: 2025-10-21 09:10:00

CLB supports layer-7 redirection. This feature allows users to configure redirection on the layer-7 HTTP/HTTPS listener.

Note:

Session persistence: If the client accesses example.com/bbs/test/123.html and session persistence has been enabled in the backend CVM, after redirection is enabled to forward traffic to example.com/bbs/test/456.html, the original session persistence mechanism will not take effect.

Redirection Overview

  1. Automatic redirection
    • Overview
      For an existing HTTPS:443 listener, an HTTP listener (port 80 by default) will be created by the system for forwarding. After the creation is successful, requests sent to HTTP:80 will be automatically redirected to HTTPS:443.
    • Use case
      Forced HTTPS redirection, namely redirecting HTTP requests to HTTPS. When a user accesses a web service in a PC or mobile browser over HTTP, CLB will redirect all requests sent to HTTP:80 to HTTPS:443 for forwarding.
    • Solution strengths
      • Set-and-forget configuration: Forced HTTPS redirection can be implemented for a domain name with only one configuration operation.
      • Convenient update: If the number of URLs of the HTTPS service changes, you only need to use this feature again in the console for refreshing.
  2. Manual redirection
    • Introduction
      You can configure one-to-one redirection. For example, in a CLB instance, you can configure redirection of listener 1/domain name 1/URL 1 to listener 2/domain name 2/URL 2.
    • Use case
      Single-path redirection. For example, if you want to take your web workload offline temporarily (because of product sellout, page maintenance, or update and upgrade), the original page needs to be redirected to a new page. If no redirection is performed, the old address in a visitor's favorites and search engine database will return a page which displays a 404/503 error message, degrading the user experience and resulting in traffic waste.

Automatic Redirection

Converge Cloud CLB supports one-click forced redirection from HTTP to HTTPS.
Assume that a developer needs to configure the website https://www.example.com, so that its users can visit it securely over HTTPS no matter whether they send HTTP requests (http://www.example.com) or HTTPS requests (https://www.example.com) in the browser.

Prerequisites

An HTTPS:443 listener has been configured.

Operation Steps

  1. Configure the CLB HTTPS listener in the CLB console and set up the web environment of https://example.com. For details, see Configuring an HTTPS Listener.

  2. Configure the HTTPS listener.

  3. In the Redirection Configuration tab of the CLB instance details, click Create Redirection Configuration.

  4. Select Automatically Configure Redirection. Then, select the configured HTTPS listener and domain name, and a redirection status code in the Domain Name Configuration section. Click Next Step: Configure Path.

    Note:

    The status codes are 301 (Moved Permanently), 302 (Move Temporarily), and 307 (Temporary Redirect). For details, see HTTP/1.1 (RFC 7231).

  5. Click Submit to complete the configuration.

  6. After the redirection configuration is completed, you can see that the HTTP:80 listener has been automatically configured for the HTTPS:443 listener, and all HTTP traffic will be automatically redirected to HTTPS.

Manual redirection

Converge Cloud CLB supports configuring one-to-one redirection.
For example, you used a forsale page for your promotional campaign. Now the campaign ends and you need to redirect the campaign page https://www.example.com/forsale to the new homepage https://www.new.com/index.

Prerequisites

  • An HTTPS listener has been configured.
  • The forwarding domain name https://www.example.com/forsale has been configured.
  • The forwarding domain name and path https://www.new.com/index have been configured.

Operation Steps

  1. Configure the CLB HTTPS listener in the CLB console and set up the web environment of https://example.com. For details, see Configuring an HTTPS Listener.

  2. Configure the HTTPS listener.

  3. In the Redirection Configuration tab of the CLB instance details, click Create Redirection Configuration.

  4. Select Manually Configure Redirection, and then select the originally accessed frontend protocol port HTTPS:443 and domain name https://www.example.com/forsale, as well as the frontend protocol port HTTPS:443 and domain name https://www.new.com/index after redirection. In Domain Configuration, select a redirection status code, and select or clear the URL reservation check box. Then click Next Step: Configure Path.

  5. Select /forsale as the original access path and /index as the access path after redirection. Then, click Submit to complete the configuration.

  6. After the redirection configuration is completed, you can see that in the HTTP:443 listener, https://www.example.com/forsale has been redirected to https://www.new.com/index.