Updated on 2024-09-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-ELB-ID

Transfer Load Balancer ID

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

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

X-Forwarded-Proto

Rewrite X-Forwarded-Proto

  • If this option is enabled, the listener protocol will be rewritten into the X-Forwarded-Proto header field and transmitted to the backend servers.
  • If this option is disabled, the protocol used by the client will be transmitted to the backend servers through the X-Forwarded-Proto header.

Supported

X-Real-IP

Rewrite X-Real-IP

  • If this option is enabled, the source IP address of the client will be rewritten into the X-Real-IP header and transmitted to the backend servers.
  • If this option is disabled, the X-Real-IP 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. Go to the load balancer list page.
  2. You can enable these header features in either of the following ways:
    • On the displayed page, locate the load balancer and click its name. Under Listeners, click Add Listener.
    • On the displayed page, locate the load balancer and click Add Listener in the Operation column.
  3. On the Configure Listener page, expand Advanced Settings and enable the features as needed.
  4. Configure the listener as prompted.
  5. Confirm the configuration and click Submit.

Modifying HTTP Header Features

  1. Go to the load balancer list page.
  2. On the displayed page, locate the load balancer and click its name.
  3. Click the Listeners tab, locate the target listener and click Edit in Operation column.
  4. On the displayed page, expand Advanced Settings and enable or disable the features.
  5. Click OK.