Updated on 2024-04-19 GMT+08:00

Rewriting the X-Forwarded-Host Field

Rewriting the X-Forwarded-Host header of the client allows ELB to add the host information in the request header of the client to the X-Forwarded-Host header and transmits the request to backend servers.

Scenarios

When you add an HTTPS or HTTP listener to a load balancer, the function of rewriting the X-Forwarded-Host header field is enabled by default.

This function allows ELB to rewrite the X-Forwarded-Host header field based on the Host field in the client request and transmit the rewritten header to backend servers.

You can disable it at any time if you no longer need it. The following are operations for disabling this function on the management console.

This function is available only for HTTP and HTTPS listeners.

Disabling the Function

  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. Hover on in the upper left corner to display Service List and choose Network > Elastic Load Balance.
  4. In the load balancer list, locate the load balancer and click its name.
  5. Click the Listeners tab, identify the row where the target listener is located, and click Edit in Operation column.
  6. Expand Advanced Settings and disable Rewrite X-Forwarded-Host.