Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
Help Center/ Elastic Load Balance/ Best Practices/ Using Advanced Forwarding for Application Iteration

Using Advanced Forwarding for Application Iteration

Updated on 2025-01-27 GMT+08:00

Scenarios

As the business grows, you may need to upgrade your application based on user feedback. In this process, you can use advanced forwarding to redirect requests from users to both the new and old version first. When the application of the new version runs stably, direct all the requests to the new version.

Prerequisites

Six ECSs are available, with three having the application of the old version deployed and the other three having the new version deployed.

Process for Configuring Advanced Forwarding

Figure 1 Flowchart
Table 1 Resource planning

Resource Name

Resource Type

Description

ELB-Test

Dedicated load balancer

Only dedicated load balancers support advanced forwarding.

Server_Group-Test01

Backend server group

Used to manage the ECSs where the application of the old version is deployed.

Server_Group-Test02

Backend server group

Used to manage the ECSs where the application of the new version is deployed.

ECS01

ECS

Used to deploy the application of the old version and added to Server_Group-Test01.

ECS02

ECS

Used to deploy the application of the old version and added to Server_Group-Test01.

ECS03

ECS

Used to deploy the application of the old version and added to Server_Group-Test01.

ECS04

ECS

Used to deploy the application of the new version and added to Server_Group-Test02.

ECS05

ECS

Used to deploy the application of the new version and added to Server_Group-Test02.

ECS06

ECS

Used to deploy the application of the new version and added to Server_Group-Test02.

NOTE:

In this practice, the dedicated load balancer is in the same VPC as the ECSs. You can also add servers in a different VPC or in an on-premises data center as needed. For details, see Using IP as a Backend to Route Traffic Across Backend Servers.

Step 1: Configure a Dedicated Load Balancer

  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 in the upper left corner to display Service List and choose Networking > Elastic Load Balance.
  4. In the upper right corner, click Buy Elastic Load Balancer.
  5. Create a dedicated load balancer and configure the parameters as follows.
  6. Add an HTTP listener to ELB-Test. For details, see Adding a Listener.
  7. Enable advanced forwarding. For details, see Advanced Forwarding Policy.
    Figure 2 Enabling advanced forwarding

Step 2: Create Two Backend Server Groups and Add Backend Servers to Them

  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 in the upper left corner to display Service List and choose Networking > Elastic Load Balance.
  4. In the navigation pane on the left, choose Elastic Load Balance > Backend Server Groups.
  5. Click Create Backend Server Group in the upper right corner.
    • Name: Server_Group-Test01
    • Load Balancer: Select ELB-Test.
    • Backend Protocol: HTTP
    • Configure other parameters as required.
  6. Repeat Step 5 to create backend server group Server_Group-Test02.
  7. Add ECS01, ECS02, and ECS03 to backend server group Server_Group-Test01.
  8. Add ECS04, ECS05, and ECS06 to backend server group Server_Group-Test02.

Forwarding Requests to Different Versions of the Application Based on HTTP Request Methods

Configure two advanced forwarding policies with the HTTP request method as the condition to route GET and DELETE requests to the application of the old version and POST and PUT requests to the application of the new version. When the application of the new version runs stably, direct all the requests to the new version.

Figure 3 Forwarding requests based on HTTP request methods
  1. Locate the dedicated load balancer and click its name ELB-Test.
  2. On the Listeners tab, locate the HTTP listener added to the dedicated load balancer and click its name.
  3. Switch to the Forwarding Policies tab on the right, and click Add Forwarding Policy to forward requests to application of the old version.

    Select GET and DELETE from the HTTP request method drop-down list, select Forward to a backend server group for Action, and select Server_Group-Test01 from the drop-down list.

    Figure 4 Forwarding GET and DELETE requests to the application of the old version
  4. Click Save.
  5. Repeat the preceding steps to add a forwarding policy to forward PUT and POST requests to the application of the new version.

    Select PUT and POST from the HTTP request method drop-down list, select Forward to a backend server group for Action, and select Server_Group-Test02 from the drop-down list.

    Figure 5 Forwarding PUT and POST requests to the application of the new version

Forwarding Requests to Different Versions of the Application Based on HTTP Headers

If the old version supports both Chinese and English, but the new version only supports English because the Chinese version is still under development, you can configure two advanced forwarding policies with the HTTP header as the condition to route requests to the Chinese application to the old version and requests to the English application to the new version. When the application of the new version supports the Chinese, direct all the requests to the new version.

Figure 6 Smooth application transition between the old and new versions based on the HTTP request header
  1. Locate the dedicated load balancer and click its name ELB-Test.
  2. On the Listeners tab, locate the HTTP listener added to the dedicated load balancer and click its name.
  3. Switch to the Forwarding Policies tab on the right, and click Add Forwarding Policy to forward requests to application of the old version.

    Select HTTP header from the drop-down list, set the key to Accept-Language and value to en-us, set the action to Forward to a backend server group, and select Server_Group-Test01 as the backend server group.

    Figure 7 Forwarding requests to the application of the old version
  4. Click Save.
  5. Repeat the preceding steps to add a forwarding policy to forward requests to the application of the new version.

    Select HTTP header from the drop-down list, set the key to Accept-Language and value to zh-cn, set the action to Forward to a backend server group, and select Server_Group-Test02 as the backend server group.

    Figure 8 Forwarding requests to the application of the new version

Forwarding Requests to Different Versions of the Application Based on Query Strings

If the application is deployed across regions, you can configure two advanced forwarding policies with query string as the condition to forward requests to the application in region 1 to the old version and requests to the application in region 2 to the new version. When the application of the new version runs stably, direct all the requests to the new version.

Figure 9 Forwarding requests based on query strings
NOTE:
  • Dedicated load balancers can distribute traffic across regions or VPCs.
  • In this example, you need to use Cloud Connect to connect the VPCs in two regions and then use a dedicated load balancer to route traffic to backend servers in the two regions.
  1. Locate ELB-Test and click its name.
  2. On the Listeners tab, locate the HTTP listener added to the dedicated load balancer and click its name.
  3. Switch to the Forwarding Policies tab on the right, and click Add Forwarding Policy to forward requests to application of the old version.

    Select Query string from the drop-down list, set the key to region and value to region01, set Action to Forward to a backend server group, and select Server_Group-Test01 as the backend server group.

    Figure 10 Forwarding requests to the old version
  4. Click Save.
  5. Repeat the preceding steps to add a forwarding policy to forward requests to the application of the new version.

    Select Query string from the drop-down list, set the key to region and value to region02, set Action to Forward to a backend server group, and select Server_Group-Test02 as the backend server group.

    Figure 11 Forwarding requests to the new version

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback