HttpHeadersFilters are applied to requests before sending them downstream, such as in the NettyRoutingFilter.
The Forwarded Headers Filter creates a Forwarded header to send to the downstream service. It adds the Host header, scheme and port of the current request to any existing Forwarded header.
The RemoveHopByHop Headers Filter removes headers from forwarded requests. The default list of headers that is removed comes from the IETF.
The default removed headers are:
To change this, set the spring.cloud.gateway.filter.remove-non-proxy-headers.headers property to the list of header names to remove.
The XForwarded Headers Filter creates various a X-Forwarded-* headers to send to the downstream service. It users the Host header, scheme, port and path of the current request to create the various headers.
Creating of individual headers can be controlled by the following boolean properties (defaults to true):
spring.cloud.gateway.x-forwarded.for.enabledspring.cloud.gateway.x-forwarded.host.enabledspring.cloud.gateway.x-forwarded.port.enabledspring.cloud.gateway.x-forwarded.proto.enabledspring.cloud.gateway.x-forwarded.prefix.enabledAppending multiple headers can be controlled by the following boolean properties (defaults to true):
spring.cloud.gateway.x-forwarded.for.appendspring.cloud.gateway.x-forwarded.host.appendspring.cloud.gateway.x-forwarded.port.appendspring.cloud.gateway.x-forwarded.proto.appendspring.cloud.gateway.x-forwarded.prefix.append