mirror of
https://github.com/spring-projects/spring-boot.git
synced 2026-10-03 15:59:31 +00:00
Refine Forwarded headers configuration for Reactor servers
This commit introduces new properties for configuring the HTTP headers that should be used for forward support. The new `server.netty.forwarded-headers.header-format` property allows "standard" or "x_forwarded" to select "Forwarded" or "X-Forwarded-*" headers. This aligns the behavior of Netty server with the "FRAMEWORK" strategy. Closes gh-51031
This commit is contained in:
@@ -521,8 +521,8 @@ If your web server of choice supports the set of HTTP headers you need, setting
|
||||
| xref:how-to:webserver.adoc#howto.webserver.use-behind-a-proxy-server.jetty[]
|
||||
|
||||
| Reactor Netty
|
||||
| `"X-Forwarded-*"`
|
||||
|
|
||||
| `"X-Forwarded-*"`, `"Forwarded"`
|
||||
| xref:how-to:webserver.adoc#howto.webserver.use-behind-a-proxy-server.reactor-netty[]
|
||||
|
||||
|===
|
||||
|
||||
@@ -587,6 +587,24 @@ For more specific options, you can switch off the forwarded configuration (using
|
||||
|
||||
|
||||
|
||||
[[howto.webserver.use-behind-a-proxy-server.reactor-netty]]
|
||||
=== Customize Reactor Netty's Proxy Configuration
|
||||
|
||||
If you use Reactor Netty, you can additionally configure the type of the headers used to carry "`forwarded`" information.
|
||||
By default, the `"X-Forwarded-*"` format is used, but you can opt into the standard RFC variant:
|
||||
|
||||
[configprops,yaml]
|
||||
----
|
||||
server:
|
||||
netty:
|
||||
forwarded-headers:
|
||||
header-format: "standard"
|
||||
----
|
||||
|
||||
For more specific options, you can switch off the forwarded configuration (using `server.forward-headers-strategy=NONE`) and directly use `reactor.netty.http.server.HttpServer` forwarded header support to change the HTTP configuration.
|
||||
|
||||
|
||||
|
||||
[[howto.webserver.enable-multiple-connectors]]
|
||||
== Enable Multiple Connectors
|
||||
|
||||
|
||||
Reference in New Issue
Block a user