mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-09-03 04:03:22 +08:00
Merge branch '3.0.x' into 3.1.x
Closes gh-38071
This commit is contained in:
commit
86a1fb0949
@ -452,8 +452,8 @@ There are also non-standard headers, like `X-Forwarded-Host`, `X-Forwarded-Port`
|
|||||||
If the proxy adds the commonly used `X-Forwarded-For` and `X-Forwarded-Proto` headers, setting `server.forward-headers-strategy` to `NATIVE` is enough to support those.
|
If the proxy adds the commonly used `X-Forwarded-For` and `X-Forwarded-Proto` headers, setting `server.forward-headers-strategy` to `NATIVE` is enough to support those.
|
||||||
With this option, the Web servers themselves natively support this feature; you can check their specific documentation to learn about specific behavior.
|
With this option, the Web servers themselves natively support this feature; you can check their specific documentation to learn about specific behavior.
|
||||||
|
|
||||||
If this is not enough, Spring Framework provides a {spring-framework-docs}/web.html#filters-forwarded-headers[ForwardedHeaderFilter].
|
If this is not enough, Spring Framework provides a {spring-framework-docs}/web.html#filters-forwarded-headers[ForwardedHeaderFilter] for the servlet stack and a {spring-framework-docs}/web-reactive.html#webflux-forwarded-headers[ForwardedHeaderTransformer] for the reactive stack.
|
||||||
You can register it as a servlet filter in your application by setting `server.forward-headers-strategy` is set to `FRAMEWORK`.
|
You can use them in your application by setting configprop:server.forward-headers-strategy[] to `FRAMEWORK`.
|
||||||
|
|
||||||
TIP: If you are using Tomcat and terminating SSL at the proxy, configprop:server.tomcat.redirect-context-root[] should be set to `false`.
|
TIP: If you are using Tomcat and terminating SSL at the proxy, configprop:server.tomcat.redirect-context-root[] should be set to `false`.
|
||||||
This allows the `X-Forwarded-Proto` header to be honored before any redirects are performed.
|
This allows the `X-Forwarded-Proto` header to be honored before any redirects are performed.
|
||||||
|
Loading…
Reference in New Issue
Block a user