gateway icon indicating copy to clipboard operation
gateway copied to clipboard

Add hostname to BackendEndpoint

Open Ri7ay opened this issue 6 months ago • 4 comments

Description: Currently, the BackendEndpoint resource in Envoy Gateway supports only an address IP and port, but does not include a distinct hostname field. This means that when an endpoint is specified by IP, Envoy’s auto_host_rewrite feature cannot rewrite the HTTP Host header, because there is no hostname to rewrite to. We would like to add an optional hostname field to BackendEndpoint, so that users can: Define an upstream by its IP address (for example, in cases where the service has no stable DNS name or uses private IPs). Specify a hostname to be used as the HTTP Host header when auto_host_rewrite is enabled on the Envoy cluster. With this addition, Envoy Gateway will: Continue to route traffic to the specified IP address. When auto_host_rewrite is set to true, inject the configured hostname into the outgoing HTTP request’s Host header.

It is proposed to add a hostname field to BackendEndpoint, similar to the proto type Envoy config.endpoint.v3.Endpoint.

[optional Relevant Links:]

https://gateway.envoyproxy.io/docs/api/extension_types/#backendendpoint https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/route/v3/route_components.proto https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/endpoint/v3/endpoint_components.proto

Ri7ay avatar Jun 09 '25 19:06 Ri7ay

hey @Ri7ay you can use the fqdn field (short for fully qualified domain name) to represent a hostname, closing this for now, feel free to reopen if you have more questions

arkodg avatar Jun 09 '25 19:06 arkodg

added this to the community meeting agenda item for today

arkodg avatar Jun 10 '25 16:06 arkodg

we discussed this in the community meeting this week, and adding an optional Hostname field in the Backend API is reasonable addition, adding the help-wanted tag to this

arkodg avatar Jun 12 '25 17:06 arkodg

I will take this

Ri7ay avatar Jun 12 '25 17:06 Ri7ay

This issue has been automatically marked as stale because it has not had activity in the last 30 days.

github-actions[bot] avatar Jul 12 '25 20:07 github-actions[bot]

we discussed this in the community meeting this week, and adding an optional Hostname field in the Backend API is reasonable addition, adding the help-wanted tag to this

The feature is not finished yet, we really want it. While BackendTLSPolicy allows specifying an SNI hostname, it does not influence the HTTP Host header. This creates a gap in functionality where: TLS SNI can be set, but the HTTP Host header still defaults to the original request or is left empty. This feature will close that gap and provide a complete solution for controlling both TLS SNI and HTTP Host header independently or in tandem.

@arkodg, could we continue and add hostname to endpoint config?

Inode1 avatar Aug 09 '25 20:08 Inode1

this feature should be available in v1.5.0 @Inode1

arkodg avatar Aug 11 '25 19:08 arkodg