Websphere 8.5 http转发到https

时间:2014-09-22 06:13:14

标签: https websphere

我可以浏览我的网站,例如 http://xxx.xxx:9080 / app_name

实际上,我想输入 http://xxx.xxx/app_name ,然后转发到 https://xxx.xxx:9443 / app_name

提前致谢。

现在浏览 http://xxx.xxx/app_name 即可,但我仍然无法将 http://xxx.xxx/app_name 路由到 https ://xxx.xxx:9443 / APP_NAME 即可。现在我可以直接输入 https://xxx.xxx:9443 / app_name 进行浏览,但我想从 http://xxx.xxx/app_name 路由到< strong> https://xxx.xxx:9443 / app_name

1 个答案:

答案 0 :(得分:0)

点击此链接进行更长时间的讨论Websphere: security-constraint in web.xml is not enforced,但简而言之,您需要将以下内容添加到web.xml,以便将WAS重定向到Https:

<security-constraint>
    <display-name>allApp</display-name>
    <web-resource-collection>
        <web-resource-name>allresources</web-resource-name>
        <url-pattern>/*</url-pattern>
    </web-resource-collection>
    <user-data-constraint>
        <transport-guarantee>CONFIDENTIAL</transport-guarantee>
    </user-data-constraint>
</security-constraint>

更新

根据评论更新。
如果要从http://xxx.xxx/app_name重定向到https://xxx.xxx:9443/app_name,除了web.xml更改之外,还需要将WAS中的默认http端口从9080更改为80。在这种情况下,您的所有应用都将在没有9080端口的WAS上可用,例如http://xxx.xxx/app_name http://xxx.xxx/app_nameN
在网络管理控制台中,转到Servers > WebSphere Application Servers > server1,然后在右侧部分中查找Ports链接。单击并将WC_defaulthost从9080更改为80.保存并重新启动服务器。 (在进行此更改之前,请确保80端口是空闲且可用的)。