我在Weblogic(10.3)应用程序中有一个webapp。 Weblogic在端口7001上侦听常规连接,在7002上侦听SSL连接。
该应用程序位于Sun ONE Web服务器( aka iPlanet)6.1后面,它在端口80上侦听HTTP请求,443在HTTPS请求上侦听,并重定向到相应的weblogic端口。
我希望我的webapp只能在安全连接上运行,所以我在我的web.xml文件中添加了security-constraint
:
<security-constraint>
<web-resource-collection>
<web-resource-name>securedapp</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>
这会将传入的请求重定向到HTTPS,但也会将weblogic端口附加到URL。例如,传入请求http://example.com/
被重定向到https://example.com:7002/
。这是一个问题,因为:
有没有办法配置重定向,以便除协议外不会触及传入的URL?这样http://example.com/
会被重定向到https://example.com/
?
这与How to avoid redirecting to SSL port基本相同,但对于Weblogic。理想情况下,它应该是一个特定于webapp的解决方案,但我也对应用程序范围或最坏情况的服务器范围的解决方案持开放态度。
答案 0 :(得分:4)
您可以设置frontendhost值和安全端口值,这可以在域/服务器级别设置
这将确保您的服务器IP和端口不会附加到网址。
您是否也在WebLogic Server中设置了WebLogic Plug-in Enabled Control?
答案 1 :(得分:1)
我们有webserver,f5也在weblogic面前。我们的weblogic根本没有启用ssl listerning,其他设备负责ssl。但由于新要求需要我们使用安全cookie,我们必须自动将http重定向到https,以下是我们的工作
当启用ssl监听(默认为7002)时,weblogic将自动将http重定向到https,以适应web.xml配置(CONFIDENTIAL) frontend-https-port将使用443覆盖7002。