我已经编写了一组重定向规则
http://server.com/application/c/<UserIdValue>
http://localserver.com/application/?userid=<UserIdValue>
我在apache httpd.conf中写了以下规则
<Location /application>
ProxyPassReverse http://server.com/application/
RewriteEngine On
RewriteCond %{REQUEST_URI} /c/ [NC]
RewriteRule application/c/(.*)$ http://localserver.com/application/?userid=$1 [QSA,P]
有了这个,我可以访问我的应用程序中的登录页面和其他页面,但是当我尝试在应用程序中登录/注销时,它会进入&#39; localserver&#39;位置。
问题在于弹簧安全 j_spring_security_check, j_spring_security_logout
。我不知道该怎么办。
Spring安全性优先于代理传递!!!!!
答案 0 :(得分:1)
要使其发挥作用,您需要更改两件事:
问题1的原因是Spring Security没有规范化URI,因此如果代理为应用服务器提供了http://server.com/application//j_spring_security_check之类的URI,则Spring Security拦截器会将其与http://server.com/application/j_spring_security_check进行匹配,注意由于额外的斜线,它是不同的,并拒绝拦截请求。