# Handle Forwarded Headers in Spring Boot

DevFeed: [Handle Forwarded Headers in Spring Boot](<https://devfeed.tech/articles/handle-forwarded-headers-in-spring-boot-109195.md>)

Original publisher: [Read original article](<https://www.baeldung.com/spring-boot-handle-forwarded-headers>)

Author: Saikat Chakraborty

Published: 2026-10-30T11:42:54Z

Content type: tutorial

Language: en

Sources: [Baeldung](<https://devfeed.tech/sources/baeldung.md>)

Topics: [Spring Boot](<https://devfeed.tech/topics/spring-boot.md>), [API Logging](<https://devfeed.tech/topics/api-logging.md>), [REST API](<https://devfeed.tech/topics/rest-api.md>), [container native](<https://devfeed.tech/topics/container-native.md>)

Tags: [alpine](<https://devfeed.tech/tags/alpine.md>), [docker](<https://devfeed.tech/tags/docker.md>), [docker-compose](<https://devfeed.tech/tags/docker-compose.md>), [dockerfile](<https://devfeed.tech/tags/dockerfile.md>), [headers](<https://devfeed.tech/tags/headers.md>), [http-post](<https://devfeed.tech/tags/http-post.md>), [java-web](<https://devfeed.tech/tags/java-web.md>), [java-web-spring-boot-http-post](<https://devfeed.tech/tags/java-web-spring-boot-http-post.md>), [spring-boot](<https://devfeed.tech/tags/spring-boot.md>)

## AI overview

Forwarded headers let an application behind a proxy recover client and public-request details that are otherwise hidden by the network hop. Spring Boot offers three strategies: None ignores them; Native delegates processing to the web server (Tomcat's RemoteIpValve), which restores scheme, host, port, and client address but does not apply X-Forwarded-Prefix to the request URL; Framework uses ForwardedHeaderFilter and includes the prefix. The excerpt's Nginx example sets X-Forwarded-* and RFC Forwarded headers, and warns to append X-Forwarded-For only when it comes from a trusted internal service to prevent spoofing. Framework and Native should not both be enabled because that duplicates processing. The default is None except on recognized cloud platforms, where Native is enabled.

## Source excerpt

Learn various strategies for handling forwarded headers in a Spring Boot application. The post Handle Forwarded Headers in Spring Boot first appeared on Baeldung.