Spring MVC “redirect:” prefix always redirects to http — how do I make it stay on https?

后端 未结 7 1214
鱼传尺愫
鱼传尺愫 2020-12-07 16:28

I solved this myself, but I spent so long discovering such a simple solution, I figured it deserved to be documented here.

I have a typical Spring 3 MVC setup with

7条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-07 17:13

    Since Spring Boot 2.1 you have to add the following configuration to your application.properties:

    server.use-forward-headers=true 
    

    or application.yml:

    server:
      use-forward-headers: true
    

提交回复
热议问题