Spring Boot 4.2.0 (19 November 2026) moves proxy settings to server.request.header.forwarded. Mapping, startup failures and a verification plan.
The property moved, and the old one still works for now
Spring Boot 4.2.0 was released on 19 November 2026. Its release notes list "Refine forwarded header support" as a new feature, which undersells the change for anyone running behind a load balancer. The commit that closes that issue, 7af7929 for gh-52800, unifies forwarded-header configuration under a new property group, server.request.header.forwarded, with three properties: strategy, naming and use-prefix. The long-standing server.forward-headers-strategy property is deprecated and still honoured, with rules about how the two interact that can stop an application from starting.
Forwarded headers are how an application behind a TLS-terminating proxy learns the scheme, host, port and client address of the original request. When they are not applied, getRequestURL returns the internal address, isSecure returns false, and absolute links and redirects point at the wrong place. When they are applied too broadly, a client can claim any address it likes. This guide covers what 4.2.0 changed, based on reading the 4.2.0 source and the how-to documentation at the v4.2.0 tag, how to migrate configuration, and how to verify the result.
The new property group
The 4.2.0 how-to page for running behind a front-end proxy shows the new form.
# Author: Sandeep Belgavi. Spring Boot 4.2 forwarded-header settings.
server:
request:
header:
forwarded:
strategy: web-server # web-server | framework | none
naming: x-forwarded # x-forwarded | rfc-7239
use-prefix: false # honour X-Forwarded-PrefixThe strategy property decides who applies the headers. web-server uses the embedded server's own support: Tomcat's RemoteIpValve, or the equivalent in Jetty and Reactor Netty. framework uses Spring Framework's ForwardedHeaderFilter for servlet applications or ForwardedHeaderTransformer for reactive ones. none ignores forwarded headers. The documentation recommends web-server whenever possible because it is more efficient than the framework's generic support.
The naming property chooses between the de facto X-Forwarded-* headers and the standard Forwarded header from RFC 7239. The documentation notes that RFC 7239 is a standard with low adoption, so X-Forwarded-* is the more likely choice. use-prefix enables X-Forwarded-Prefix, which carries a path prefix the proxy stripped. The record that holds these settings, ForwardedRequestHeaders, asserts that use-prefix can only be used with x-forwarded naming, so combining use-prefix true with rfc-7239 fails.
When strategy is not set, the documentation says it defaults to web-server if the application runs on a supported cloud platform and none otherwise. That default is the most common source of surprise: the same artifact handles forwarded headers on Kubernetes or Cloud Foundry and ignores them on a virtual machine behind the same kind of proxy.
One request under each strategy
Take a synthetic request for the Belgavi's Book Store order page. The browser connects over HTTPS to the load balancer, which terminates TLS and forwards plain HTTP to the application on port 8080, adding X-Forwarded-Proto: https, X-Forwarded-Host: books.example.com and X-Forwarded-For: 203.0.113.7.
With web-server, the embedded server rewrites the request before any Spring code sees it, so a controller, a security filter and an access log all observe https, books.example.com and 203.0.113.7. With framework, the same values appear to code that runs after the filter or transformer in the chain; components that run earlier, such as a servlet container access log, still see the internal values. With none, every component sees http, the internal host and the load balancer's address. A redirect to the login page under none therefore sends the browser to an http URL on an internal host name, which is the symptom most teams notice first.
How the old property is mapped
The ForwardedHeaderStrategy enum in 4.2.0 reads both the new property and the deprecated one. If only the old property is set, its values are mapped: native becomes web-server, framework stays framework, none stays none. If both are set, it throws MutuallyExclusiveConfigurationPropertiesException, which fails the application at startup.
That last rule makes partial migrations dangerous. A team that adds the new property to a shared base configuration while one service still sets the old one in its own file will find out at deployment time. The companion example is a small static checker for flat properties files that reports exactly that case, the use-prefix and naming conflict, the implicit default, and an empty Tomcat internal-proxies value. It encodes the rules from the 4.2.0 source; it does not start Spring, so it complements rather than replaces a startup test.
legacy_native effective web-server deprecated: replace server.forward-headers-strategy=native
both_set startup failure the two properties are mutually exclusive
rfc_with_prefix startup failure use-prefix requires x-forwarded naming
unset_local effective none implicit default; check behind a TLS proxyTwo regressions fixed before release
The issue history explains why the refinement was made late in the release cycle, and it is a useful list of things to test.
Issue gh-52531, filed against a 4.2.0 release candidate, reported that applications using @EnableWebMvc or @EnableWebFlux with the framework strategy silently ignored forwarded headers, because the filter and transformer had moved into auto-configurations that back off when those annotations are present. The report shows getRequestURL returning the internal http address, isSecure returning false and getRemoteAddr returning the proxy's address, where 4.1.2 returned the original values. The gh-52800 commit restored the previous bean arrangement.
Pull request gh-52806, merged on 13 November and listed among the 4.2.0 bug fixes, then fixed a follow-on problem: after the refinement, reactive web servers no longer detected the cloud platform, so a WebFlux application on Kubernetes without an explicit strategy stopped applying X-Forwarded-* headers. Servlet applications were not affected.
Both were fixed before 4.2.0, so they should not appear on the release itself. They show where to look if you upgrade from a 4.2 milestone or release candidate, and they show why relying on the cloud-platform default is fragile: platform detection is one more moving part between the header and your application.
Migration steps
Search every configuration source for forward-headers-strategy, including profile-specific files, environment variables such as SERVER_FORWARDHEADERSSTRATEGY, and configuration servers. Replace each occurrence with server.request.header.forwarded.strategy using the mapping above, and remove the old property in the same change.
Set strategy explicitly in every environment, including local development, rather than relying on cloud detection. If the application must ignore forwarded headers, say none rather than leaving it unset.
If you use Tomcat, review server.tomcat.remoteip.internal-proxies. The RemoteIpValve trusts X-Forwarded-For only from addresses matching that expression; the documentation shows how to set it and warns that an empty value trusts all proxies and should not be used in production. If your load balancer's addresses are outside the default private ranges, set the expression to match them, otherwise the valve will ignore the headers you expect it to apply.
If you previously configured Tomcat's valve yourself, the documentation now says to set strategy to none and register your own valve with a WebServerFactoryCustomizer bean.
Verifying behind a proxy
The decisive test is an endpoint that echoes what the application believes about the request, called through the real proxy and directly. The snippet below is an illustrative Spring controller for a staging environment; it was not compiled or run for this guide.
// Author: Sandeep Belgavi. Staging-only diagnostic; remove after verification.
@RestController
class ForwardedEcho {
@GetMapping("/internal/forwarded-echo")
Map<String, Object> echo(HttpServletRequest request) {
return Map.of("url", request.getRequestURL().toString(),
"secure", request.isSecure(),
"remote", request.getRemoteAddr());
}
}Through the TLS-terminating proxy, expect an https URL with the public host, secure true, and the client's address. Called directly with forged headers from an address outside internal-proxies, expect the internal URL and the caller's own address; if the forged values appear, the application trusts headers it should not. Run the check once per strategy you deploy and keep the expected outputs with the configuration.
When this does not apply
An application that never builds absolute URLs, never checks isSecure and does not log or authorise by client address can run without forwarded-header handling. Most applications do one of those things somewhere, often in a security filter or an OAuth2 redirect, so the safer default is to configure and verify the strategy explicitly.