mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-07-15 01:07:30 +08:00
Merge branch '2.7.x' into 3.0.x
Closes gh-38070
This commit is contained in:
commit
87742e8ee1
@ -442,8 +442,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.
|
||||
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].
|
||||
You can register it as a servlet filter in your application by setting `server.forward-headers-strategy` is set to `FRAMEWORK`.
|
||||
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 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`.
|
||||
This allows the `X-Forwarded-Proto` header to be honored before any redirects are performed.
|
||||
|
Loading…
Reference in New Issue
Block a user