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:
Brian Clozel
2026-07-31 14:10:21 +02:00
parent 607fc5cd54
commit 66a093dbfa
7 changed files with 156 additions and 6 deletions
@@ -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