When a server is behind a reverse proxy, the first part of path in URL could be used to represent the server,

For example, the application's URL is "https://www.exmaple.com/t1/app-context/", as the server is behind a reverse proxy, the "t1" is used to represent a server behind the reverse proxy, but the {baseUrl} returns "https://www.exmaple.com/app-context/", which is not correct.

The correct behavior is that the {baseURL} should return "https://www.exmaple.com/t1/app-context/"

Comment From: marcusdacoregio

Hi @zhanedw, this seems to be a duplicate of https://github.com/spring-projects/spring-security/issues/12375. You can also refer to this section of documentation about Proxy Servers.