`ForwardedHeaderTransformer` is a component that modifies the host, port, and scheme of
@ -390,7 +390,7 @@ filters, and `ForwardedHeaderTransformer` is used instead.
@@ -390,7 +390,7 @@ filters, and `ForwardedHeaderTransformer` is used instead.
[[webflux-forwarded-headers-security]]
=== Security Considerations
There are security considerations for forwarded headers, since an application cannot know
There are security considerations for forwarded headers since an application cannot know
if the headers were added by a proxy, as intended, or by a malicious client. This is why
a proxy at the boundary of trust should be configured to remove untrusted forwarded traffic coming
from the outside. You can also configure the `ForwardedHeaderTransformer` with
@ -57,7 +57,7 @@ with `removeOnly=true`, in which case it removes but does not use the headers.
@@ -57,7 +57,7 @@ with `removeOnly=true`, in which case it removes but does not use the headers.
[[filters-forwarded-headers-dispatcher]]
=== About Dispatcher Types
=== Dispatcher Types
In order to support xref:web/webmvc/mvc-ann-async.adoc[asynchronous requests] and error dispatches this
filter should be mapped with `DispatcherType.ASYNC` and also `DispatcherType.ERROR`.
As a request goes through proxies (such as load balancers) the host, port, and
As a request goes through proxies such as load balancers the host, port, and
scheme may change, and that makes it a challenge to create links that point to the correct
host, port, and scheme from a client perspective.
@ -14,7 +14,6 @@ There are other non-standard headers, too, including `X-Forwarded-Host`, `X-Forw
@@ -14,7 +14,6 @@ There are other non-standard headers, too, including `X-Forwarded-Host`, `X-Forw
`X-Forwarded-Proto`, `X-Forwarded-Ssl`, and `X-Forwarded-Prefix`.
[[x-forwarded-host]]
==== X-Forwarded-Host
@ -25,7 +24,6 @@ a proxy which forwards the request to `http://localhost:8080/resource`, then a h
@@ -25,7 +24,6 @@ a proxy which forwards the request to `http://localhost:8080/resource`, then a h
`X-Forwarded-Host: example.com` can be sent to inform the server that the original host was `example.com`.
[[x-forwarded-port]]
==== X-Forwarded-Port
@ -36,7 +34,6 @@ communicate the original port to a downstream server. For example, if a request
@@ -36,7 +34,6 @@ communicate the original port to a downstream server. For example, if a request
to inform the server that the original port was `443`.
[[x-forwarded-proto]]
==== X-Forwarded-Proto
@ -47,7 +44,6 @@ a proxy which forwards the request to `http://localhost:8080/resource`, then a h
@@ -47,7 +44,6 @@ a proxy which forwards the request to `http://localhost:8080/resource`, then a h
`X-Forwarded-Proto: https` can be sent to inform the server that the original protocol was `https`.
[[x-forwarded-ssl]]
==== X-Forwarded-Ssl
@ -58,7 +54,6 @@ original protocol (e.g. https / https) to a downstream server. For example, if a
@@ -58,7 +54,6 @@ original protocol (e.g. https / https) to a downstream server. For example, if a
original protocol was `https`.
[[x-forwarded-prefix]]
==== X-Forwarded-Prefix
@ -66,25 +61,25 @@ While not standard, https://microsoft.github.io/reverse-proxy/articles/transform
@@ -66,25 +61,25 @@ While not standard, https://microsoft.github.io/reverse-proxy/articles/transform
is a de-facto standard header that is used to communicate the original URL path prefix to a
downstream server.
The definition of the path prefix is most easily defined by an example. For example, consider
the following proxy to server mapping of:
Use of `X-Forwarded-Prefix` can vary by deployment scenario, and needs to be flexible to
allow replacing, removing, or prepending the path prefix of the target server.