Configure an HTTP listener

更新时间:
复制 MD 格式

If your application uses the HTTP protocol and does not require encrypted communication, you can add an HTTP listener to forward HTTP requests. This is useful for scenarios such as internal network communication, test and development environments, or transmitting non-sensitive information.

Prerequisites

You have created an ELB instance. For more information, see Create an ELB instance.

Procedure

  1. Log on to the ENS console.

  2. On the ELB Instance page, find the target instance, and then in the Actions column, click Listener Configuration.

  3. On the Listener tab, click Add Listener.

  4. Configure the basic settings.

    Parameter

    Description

    Listener Name

    A custom name for the listener.

    Load balancing protocol

    Select HTTP.

    Listening Port

    The port that the listener uses to receive requests and forward them to backend servers. The port range is 1 to 65535.

    Note

    Port 80 is recommended for the HTTP protocol.

    Advanced Settings

    Note

    Click Modify to expand the advanced settings.

    Scheduling Algorithm

    • Weighted Round-Robin (WRR): Backend servers with higher weights receive more requests.

    • Weighted Least Connections (WLC): Requests are distributed based on both the weight and the number of active connections for each backend server. If servers have the same weight, the one with the fewest active connections receives the next request.

    • Round-Robin (RR): Requests are distributed to backend servers sequentially.

    Redirection

    Specifies whether to redirect traffic from this HTTP listener to an HTTPS listener.

    Note

    If you enable redirection, make sure that you have already created an HTTPS listener. For more information, see Configure an HTTPS listener.

    Idle timeout

    The time in seconds that a connection can remain idle. If no requests are sent over the connection during this period, the load balancer closes it. The load balancer establishes a new connection when the next request arrives. Valid values: 1 to 60.

    Request timeout

    The time that the load balancer waits for a response from the backend server. If no response is received within this period, the load balancer returns an HTTP 504 error to the client.

    • Valid values: 1–180.

    • Unit: seconds.

    Get client IP address

    Allows backend servers to retrieve the client's real IP address. This feature is enabled by default.

  5. Click Next to configure the health check. For more information about the parameters, see Health check.

  6. After you configure the health checks, click Next. Review your settings, and then click Create.

  7. After creating the listener, you must start it manually. On the Listener tab, find your listener, and in the Actions column, click Start.