我们正在使用F5 BIG-IP设备来终止SSL连接,并通过启用了Spring的应用程序使用纯HTTP连接到应用程序服务器。此外,我们配置了F5以发送带有http或https值的X-Forwarded-Proto头。
现在,我们希望通过配置拦截URL来强制使用HTTPS:
现在,我们希望通过配置拦截URL来强制使用HTTPS:
<security:intercept-url pattern="/login.action" requires-channel="https" />
但是这只有在Servlet容器中的协议方案是HTTPS时才有效,因此我们需要解释HTTP头。
有什么想法吗?
谢谢 Simon
extends WebSecurityConfigurerAdapter
的存在,请求才会被重定向到/login
。请勿添加其他内容。 - Chloe