Updated on 2024-06-20 GMT+08:00

HTTP Headers

HTTP headers are a list of strings sent and received by both the client and server on every Hypertext Transfer Protocol (HTTP) request and response. This section describes HTTP headers supported by HTTP and HTTP listeners.

Table 1 Transfer headers

Header

Feature

Description

Dedicated Load Balancers

X-Forwarded-ELB-IP

Transfer Load Balancer EIP

If this option is enabled, the EIP bound to the load balancer will be transmitted to backend servers through the X-Forwarded-ELB-IP header.

The format is as follows (XX.XXX.XX.XXX indicates the EIP of the load balancer):

X-Forwarded-ELB-IP: XX.XXX.XX.XXX

Supported

X-Forwarded-Port

Transfer Listener Port Number

If this option is enabled, the port number used by the listener will be transmitted to backend servers through the X-Forwarded-Port header.

Supported

X-Forwarded-For-Port

Transfer Port Number in the Request

If this option is enabled, the port number used by the client will be transmitted to backend servers through the X-Forwarded-For-Port header.

Supported

Table 2 Rewrite headers

Header

Feature

Description

Dedicated Load Balancers

X-Forwarded-Host

Rewrite X-Forwarded-Host

  • If this option is enabled, the Host header of the client request will be rewritten into the X-Forwarded-Host header and transmitted to the backend servers.
  • If this option is disabled, the X-Forwarded-Host header of the client will be transmitted to the backend servers.

Supported

  • More HTTP headers are coming soon. See the available HTTP headers on the management console.
  • √ indicates the load balancer supports the header, whereas × indicates the load balancer does not support the header.

Enabling HTTP/HTTPS Headers

  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. You can enable these header features in either of the following ways:
    • On the Load Balancers page, locate the load balancer and click its name. Under Listeners, click Add Listener.
    • On the Load Balancers page, locate the load balancer and click Add Listener in the Operation column.
  5. On the Configure Listener page, expand Advanced Settings and enable the features as needed.
  6. Configure the listener as prompted.
  7. Confirm the configuration and click Submit.

Modifying HTTP Header Features

  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. On the Load Balancers page, locate the load balancer and click its name.
  5. Click the Listeners tab, locate the target listener and click Edit in Operation column.
  6. On the displayed page, expand Advanced Settings and enable or disable the features.
  7. Click OK.