Skip to content

Commit a1af996

Browse files
committed
Merge branch '2.3.x'
Closes gh-24026
2 parents a4505ea + 28f7bc3 commit a1af996

File tree

2 files changed

+5
-1
lines changed
  • spring-boot-project

2 files changed

+5
-1
lines changed

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,8 @@ public static class Tomcat {
335335

336336
/**
337337
* Whether requests to the context root should be redirected by appending a / to
338-
* the path.
338+
* the path. When using SSL terminated at a proxy, this property should be set to
339+
* false.
339340
*/
340341
private Boolean redirectContextRoot = true;
341342

spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto.adoc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -883,6 +883,9 @@ With this option, the Web servers themselves natively support this feature; you
883883
If this is not enough, Spring Framework provides a {spring-framework-docs}/web.html#filters-forwarded-headers[ForwardedHeaderFilter].
884884
You can register it as a Servlet Filter in your application by setting `server.forward-headers-strategy` is set to `FRAMEWORK`.
885885

886+
TIP: If you are using Tomcat and terminating SSL at the proxy, configprop:server.tomcat.redirect-context-root[] should be set to `false`.
887+
This allows the `X-Forwarded-Proto` header to be honored before any redirects are performed.
888+
886889
NOTE: If your application runs in Cloud Foundry or Heroku, the configprop:server.forward-headers-strategy[] property defaults to `NATIVE`.
887890
In all other instances, it defaults to `NONE`.
888891

0 commit comments

Comments
 (0)