Original destination
This is a special purpose load balancer that can only be used with an original destination cluster. Upstream host is selected based on the downstream connection metadata, i.e., connections are opened to the same address as the destination address of the incoming connection was before the connection was redirected to Envoy. New destinations are added to the cluster by the load balancer on-demand, and the cluster periodically cleans out unused hosts from the cluster. No other load balancing policy can be used with original destination clusters.
Original destination host request header
Envoy can also pick up the original destination from a HTTP header called
x-envoy-original-dst-host.
Please note that fully resolved IP address should be passed in this header. For example if a request has to be
routed to a host with IP address 10.195.16.237 at port 8888, the request header value should be set as
10.195.16.237:8888
.
Original destination filter state
Custom extensions can override the destination address using the filter state
object envoy.network.transport_socket.original_dst_address
. This behavior
can be used for tunneling to an intermediary proxy instead of the direct
original destination.