Listener Management
Creating HTTP Listeners
Listeners are used to check connection requests from clients. If your business needs to recognize the content of data, you can add an HTTP listener to forward requests from clients using the HTTP protocol.
- Log in to the Application Load Balancer (ALB) console.
- In the top-navigation bar, select the region of your ALB instance.
- Choose one of the following methods to open the listening configuration.
- On the Instance list page, click Listener Management in the Actions column of the target instance.
- On the Instance list page, click the ID or details of the target instance. On the Listener Management tab, click Add Listener.
- On the Create Listener page, complete the following configurations, then click Confirm.
Configuration | Description |
---|---|
Protocol | Choose the protocol type for listening. In this example, choose HTTP |
Port | The listening port that receives requests and forwards them to the backend server. The port range is 1~65535. The listening port cannot be duplicated within the same ALB instance. |
Load Balancing Algorithm | Choose a scheduling algorithm for load balancing: Round-robin: Distributes the user’s requests to the backend server in turns. Source address: Clients with the same source address will be scheduled to the same backend server; Weighted round-robin: Distributes the user’s requests to the backend server in turns. The higher the weight value of the backend server, the more often it will be polled. Least connections: The user’s requests are forwarded based on the number of connections of the backend server. The backend server with fewer current connections will be polled more often. Master-Slave: The backend server is divided into master nodes and spare nodes. The user’s requests will be distributed to the master node. If the master node is abnormal, the user’s requests will be forwarded to the spare node. |
Service Node | Support the setting of service nodes later and copy the service nodes of other listeners under the current instance |
Service Session Keep | Choose whether to enable or disable session keeping. By default, ALB will distribute each client’s requests to different backend servers. After you enable the session keeping function, session keep can forward requests from the same client to the same backend server, which is convenient for the backend server to maintain state information and provide a continuous experience to clients; Autogenerated KEY: The first time the client visits, ALB will return a Cookie in the set-cookie response header. During session keeping, the client brings this Cookie to access, and the load balancing service will forward the request to the previously recorded backend server. User-defined KEY: When ALB finds that the user has customized a Cookie, it will rewrite the original Cookie. During session keeping, bring the rewritten Cookie to visit, and ALB will forward the request to the previously recorded backend server. |
Connection idle timeout | Specifies the connection idle timeout. The default range is 60 seconds; if there is no access request within the timeout, ALB will temporarily interrupt the current connection until the next request comes to establish a new connection. |
Node Health Check | Choose the method of node health check; Port check: Use the port of the backend server for health check. HTTP check: Send a HEAD request to simulate the browser’s access behavior to check whether the server application is healthy. |
Data compression | Enabling this configuration will compress files of type gzip. |
Redirection | After enabling, requests accessing the current listener will be forcibly redirected to requests accessing the target listener. |
Listener Name | Enter the listener name. |
Remarks | Enter remarks for the listener. |
Create HTTPS Listeners
If your application data transmission requires security, you can create an HTTPS listener that uses encrypted connections to forward requests from the HTTPS protocol, effectively ensuring the confidentiality and integrity of data transmission.
- Log in to the Application Load Balancer (ALB) console.
- In the top-navigation bar, select the region of your ALB instance.
- Choose one of the following methods to open the listening configuration.
- On the Instance list page, click Listener Management in the Actions column of the target instance.
- On the Instance list page, click the ID or details of the target instance. On the Listener Management tab, click Add Listener.
- On the Create Listener page, finish the following configurations, then click Confirm.
Configuration | Description |
---|---|
Protocol | Choose the protocol type for listening. In this example, choose HTTPS |
Enable HTTP 2.0 | Choose whether to enable HTTP 2.0. |
SSL Certificate | Choose SSL certificates. If you need to visit multiple domains or mount multiple server certificates, you can choose to add extended certificates to this HTTPS listener after configuring HTTPS listening |
Port | The listening port that receives requests and forwards them to the backend server. The port range of 1~65535. The listening port cannot be duplicated within the same ALB instance. |
Load Balancing Algorithm | Choose one load balancing scheduling algorithm: Round-robin: Distributes the user’s requests to the backend server in turns. Source address: Clients with the same source address will be scheduled to the same backend server; Weighted round-robin: Distributes the user’s requests to the backend server in turns. The higher the weight value of the backend server, the more often it will be polled. Least connections: The user’s requests are forwarded based on the number of connections of the backend server. The backend server with fewer current connections will be polled more often. Master-Slave: The backend servers are divided into master nodes and spare nodes. The user’s requests will be distributed to the master node. If the master node is abnormal, the user’s requests will be forwarded to the spare node. |
Service Node | Support the setting of service nodes later and copy the service nodes of other listeners under the current instance |
Security Policy | Choose the security policy you want to bind, For more information, see TLS Security Policy. |
Service Session Keep | Choose whether to enable or disable session keeping. By default, ALB will distribute each client’s requests to different backend servers. After you enable the session keeping function, session keep can forward requests from the same client to the same backend server, which is convenient for the backend server to maintain state information and provide a continuous experience to clients; Autogenerated KEY: The first time the client visits, ALB will return a Cookie in the set-cookie response header. During the session keeping, the client brings this Cookie to visit, and the load balancing service will forward the request to the previously recorded backend server. User-defined KEY: When ALB finds that the user has customized a Cookie, it will rewrite the original Cookie. During session keeping, bring the rewritten Cookie to visit, and ALB will forward the request to the recorded backend server. |
Connection idle timeout | Specifies the connection idle timeout period. The default range is 60 seconds; if there is no access request within the timeout, ALB will temporarily interrupt the current connection until the next request comes to establish a new connection. |
Node Health Check | Choose the method of node health check; Port check: Use the port of the backend server for health check. HTTP check: Send a HEAD request to simulate the browser’s access behavior to check whether the server application is healthy. |
Data compression | Enabling this configuration will compress gzip file types. |
Listener Name | Enter the listener name. |
Remarks | Enter remarks for the listener. |
Modify Listeners
- Log into the Application Load Balancer (ALB) Console.
- On the top navigation bar, choose the region where the ALB instance is located.
- On the ALB list page, find the target ALB instance, click on the instance ID to go to the instance details page.
- Click on Listener Management, find the target listener, and use one of the following methods to edit the basic information of the listener:
- Click on the target listener, and under the Listener Details tab in the Basic Information area, click Change Configuration.
2. On the left side listeners list, select the listener you need to edit and click the edit button on the top right to go to the editing page.
- In the Edit Listener dialogue box, you can modify the listener’s configuration information according to business needs and click Save. This completes the modification of the listener.
Delete Listeners
- Log into the Application Load Balancer (ALB) Console.
- On the top menu bar, choose the region where the ALB instance is located.
- On the ALB Instance page, locate the target ALB instance and click on the instance ID.
- Click on the Listener Management tab, locate the target listener, and then select Delete on the top-right corner.
- In the pop-up delete listener dialogue box, click Confirm.