Skip to content

Add configuration option for Tomcat's "useRelativeRedirects" property #10597

Description

@dhay

In Spring Boot 1.5.4, when using Tomcat 8.0.30 or later, the TomcatEmbeddedServletContainerFactory sets the Tomcat context property useRelativeRedirects to false. I would like a configuration option (e.g. server.tomcat.useRelativeRedirects=true) to change this hard-coded default.

My scenario is this: I have a Spring boot application sitting behind a load balancer VIP. SSL is also terminated at the load balancer. With relative redirects set to false, the URL sent back from a redirect has both the wrong host (i.e. the host name, not the VIP) as well as the wrong scheme (http instead of https).

I know I can register TomcatContextCustomizer, but that seems like a lot of code for a single boolean value.

Thanks!

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions