HTTPS login with Spring Security redirects to HTTP

后端 未结 9 1966
梦如初夏
梦如初夏 2021-01-31 02:12

I have a Spring web app, secured with Spring Security, running on EC2. In front of the EC2 instance is an Elastic Load Balancer with an SSL cert (https terminates at the load ba

9条回答
  •  渐次进展
    2021-01-31 02:50

    I set requires-channel="any" on all intercept-urls. This allows it to still work in my dev environment where I don't use SSL.

    
    
    
    

    Then, create an apache virtual host that redirects all traffic to the HTTPS version.

    
      ServerName www.mywebsite.com
      Redirect permanent / https://www.mywebsite.com/
    
    

提交回复
热议问题