似乎无法让 RemoteIpFilter (https) 与 spring webflow 正确交互
Can't seem to get RemoteIpFilter (https) to correctly interact with spring webflow
我运行配置了Nginx (ssl) -> apache -> tomcat。 Nginx 解码 ssl 并使用 X-SSL-Request=1
header 将请求转发到 apache(然后到 tomcat)。我一直在寻找一种在我的应用程序中启用正确的 ssl 行为而不会使我的 apache 配置变得更复杂的好方法。如果我们决定弃用 apache(从而删除 AJP 协议的使用并仅依赖 http),这感觉就像是更好的解决方案。另一种方法是使用 apache 将 env.HTTPS
更改为 on
。但是我很好奇这种方法哪里出了问题。
这是我的过滤器配置:
<filter>
<filter-name>RemoteIpFilter</filter-name>
<filter-class>org.apache.catalina.filters.RemoteIpFilter</filter-class>
<init-param>
<param-name>protocolHeader</param-name>
<param-value>X-SSL-Request</param-value>
</init-param>
<init-param>
<param-name>protocolHeaderHttpsValue</param-name>
<param-value>1</param-value>
</init-param>
</filter>
现在我有一个控制器来测试实际控制器在所有这些之后看到的内容,我得到:
Request protocol HTTP/1.0
Request secure true
Request server port 443
Request url http://localsecure.xxx/common/requestTest.html
Request uri /common/requestTest.html
Request scheme https
现在 spring webflow 似乎认为 "http" 是创建重定向的协议,因此所有重定向呈现为 http://localsecure.xxx/...
而不是预期的 https://localsecure.xxx/...
.我唯一的线索是 tomcat 仍然认为请求 url 是 http://
.
我认为这是 RemoteIpFilter
中的错误。 getRequestURL
方法未被原始请求覆盖和处理。
更新 感谢该项目。已经修复:https://bz.apache.org/bugzilla/buglist.cgi?quicksearch=remoteipfilter&list_id=135019
我运行配置了Nginx (ssl) -> apache -> tomcat。 Nginx 解码 ssl 并使用 X-SSL-Request=1
header 将请求转发到 apache(然后到 tomcat)。我一直在寻找一种在我的应用程序中启用正确的 ssl 行为而不会使我的 apache 配置变得更复杂的好方法。如果我们决定弃用 apache(从而删除 AJP 协议的使用并仅依赖 http),这感觉就像是更好的解决方案。另一种方法是使用 apache 将 env.HTTPS
更改为 on
。但是我很好奇这种方法哪里出了问题。
这是我的过滤器配置:
<filter>
<filter-name>RemoteIpFilter</filter-name>
<filter-class>org.apache.catalina.filters.RemoteIpFilter</filter-class>
<init-param>
<param-name>protocolHeader</param-name>
<param-value>X-SSL-Request</param-value>
</init-param>
<init-param>
<param-name>protocolHeaderHttpsValue</param-name>
<param-value>1</param-value>
</init-param>
</filter>
现在我有一个控制器来测试实际控制器在所有这些之后看到的内容,我得到:
Request protocol HTTP/1.0
Request secure true
Request server port 443
Request url http://localsecure.xxx/common/requestTest.html
Request uri /common/requestTest.html
Request scheme https
现在 spring webflow 似乎认为 "http" 是创建重定向的协议,因此所有重定向呈现为 http://localsecure.xxx/...
而不是预期的 https://localsecure.xxx/...
.我唯一的线索是 tomcat 仍然认为请求 url 是 http://
.
我认为这是 RemoteIpFilter
中的错误。 getRequestURL
方法未被原始请求覆盖和处理。
更新 感谢该项目。已经修复:https://bz.apache.org/bugzilla/buglist.cgi?quicksearch=remoteipfilter&list_id=135019