This topic describes how to add an HTTP listener to an Application Load Balancer (ALB) instance. An HTTP listener is a process that checks for connection requests. You can configure listeners when you create an ALB instance or add listeners to an ALB instance after the ALB instance is created. HTTP is intended for applications that identify data content, such as web applications and mobile games. You can add HTTP listeners to forward HTTP requests.


Create a listener

  1. Log on to the ALB console.
  2. In the top navigation bar, select the region where the ALB instance is deployed.
  3. Use one of the following methods to open the listener configuration wizard:
    • On the Instances page, find the ALB instance that you want to manage and click Create Listener in the Actions column.
    • On the Instances page, click the ID of the ALB instance. On the Listeners tab, click Create Listener.
  4. On the Configure Listener wizard page, set the following parameters and click Next.
    Parameter Description
    Listener Protocol Select the protocol of the listener.

    HTTP is selected in this example.

    Listener Port Enter the port on which the ALB instance listens. The ALB instance listens on the port and forwards requests to backend servers. Valid values: 1 to 65535. In most cases, port 80 is used for HTTP and port 443 is used for HTTPS.
    Note The ports on which an ALB instance listens must be unique.

    The port number is set to 80 in this example.

    Listener Name Enter a name for the listener.
    Advanced Settings Click Modify to configure advanced settings.
    Idle Connection Timeout Period Specify the timeout period of idle connections. Unit: seconds. Valid values: 1 to 60.
    If no request is received within the specified timeout period, ALB closes the current connection. ALB creates a new connection when a new connection request is received.
    Note This feature is unavailable for HTTP/2 requests.
    Connection Request Timeout Period Specify the request timeout period. Unit: seconds. Valid values: 1 to 180.

    If no response is received from the backend server within the request timeout period, ALB returns an HTTP 504 error to the client.

    Enable Gzip Compression Specify whether to enable Gzip compression for a specified file type.

    Gzip supports the following file types: text/xml, text/plain, text/css, application/javascript, application/x-javascript, application/rss+xml, application/atom+xml, and application/xml.

    Add HTTP Header Fields You can add the following HTTP header fields:
    • X-Forwarded-For: Add the header field to obtain the real IP address of the client.
    • SLB-ID: Add the header field to obtain the ID of the ALB instance.
    • X-Forwarded-Proto: Add the header field to obtain the listener protocol of the ALB instance.
    • X-Forwarded-Port: Add the header field to obtain the port on which the ALB instance listens.
    • X-Forwarded-Client-Port: Add the header field to retrieve the port over which a client communicates with the ALB instance.
  5. In the Select Server Group wizard, select a server group from the drop-down list, confirm the information about the backend servers, and click Next.
  6. In the Configuration Review wizard, confirm the configuration and click Submit.