Rewriting Host Header to Server Name
Overview
When proxying a request to a back-end server through Avi Vantage, an Avi SE can rewrite the host header to the server name of the particular back-end server to which the request is forwarded. This functionality can be turned on for selected or all servers in the pool.
Enabling Rewrite Host Header Option
To provide this functionality, two options have been added to the pool editor: ###Option 1 Under the Settings tab, check the box labeled Rewrite Host Header to Server Name.
Option 2
Under the Servers tab, in the Rewrite Host Header column, check the box corresponding to the individual server for which this behavior is intended.
The pool-level check box (option /#1) takes precedence (over option /#2). If the pool-level option is selected, the behavior is on for all servers, no matter what selections have been made on a per-server basis.
If the rewrite host header to SNI is turned on as well as this feature, it takes precedence over the “to server name” feature.
Using rewrite_host_header_to_server_name with rewrite_host_header_to_sni
Below are the few observations which clarifies how rewrite_host_header_to_server_name interacts with rewrite_host_header_to_sni.
-
For Non-SSL back-end servers : rewrite_host_header_to_sni has no effect on the non-SSL back-end servers. Host Header is set according to the rewrite_host_header_to_server_name flag.
-
For SSL back-end servers with the TLS SNI Enabled flag set as OFF: The rewrite_host_header_to_sni has no effect. The Host header is set according to the rewrite_host_header_to_server_name flag.
-
For SSL back-end servers with the TLS SNI Enabled flag set as ON – Incoming Host Header = Abc.com
Note: The following combination of the configuration options is not supported because the SNI name used in the SSL handshake, and the host header used in the request do not match.
- The TLS SNI Enabled flag is set as ON.
- SNI name is configured in the pool, while the rewrite_host_header_to_server_name option is enabled.
Rewriting Host Header with Pool Member and Port Number
Prior to Avi Vantage release 21.1.1, the host header is rewritten to just the hostname of the pool member(back-end server name) without a port specified. Starting with Avi Vantage release 21.1.1, support for providing port number is available while rewriting the host header with the pool member.
To update the port to the hostname in the host header, the following options are available under the pool configuration:
- Append port if not default port for protocol (80 and 443)
- Never append port
- Always append port
The following screenshot shows the Append Port option available under the Pool > Settings on the Avi UI.