【问题标题】:How to redirect a URL http to https on WebSphere Application Server v9如何在 WebSphere Application Server v9 上将 URL http 重定向到 https
【发布时间】:2020-12-15 06:24:08
【问题描述】:

我已经在 WebSphere Application Server v9.0 上部署了一个应用程序,并通过在 httpd.conf 文件中添加以下内容为该应用程序启用了 SSL(侦听端口 443),它工作得很好。

LoadModule ibm_ssl_module modules/mod_ibm_ssl.so
<IfModule mod_ibm_ssl.c>
Listen 0.0.0.0:443
<VirtualHost *:443>
Alias /jde "Z:\IBM\WebSphere\AppServer\profiles\AppSrv/installedApps/<cellName>/<appName>.ear\webclient.war"
SSLEnable
</VirtualHost>
<Directory "Z:\IBM\WebSphere\AppServer\profiles\AppSrv/installedApps/<cellName>/<appName>.ear\webclient.war\WEB_INF">
Require all denied
</Directory>
<Directory "Z:\IBM\WebSphere\AppServer\profiles\AppSrv/installedApps/<cellName>/<appName>.ear\webclient.war">
Require all granted
</Directory>
SSLDisable
KeyFile Z:\IBM\HTTPServer/<srvrname>.kdb

我现在可以使用 URL https://srvrname/jde/E1Menu.maf 成功访问应用程序

当用户在浏览器中输入 http://srvrname/jde/E1Menu.maf 时,是否可以将 URL 更新/重定向到 https://srvrname/jde/E1Menu.maf。谢谢!

【问题讨论】:

    标签: http https websphere http-redirect


    【解决方案1】:

    通过将以下内容添加到 httpd.conf 来使用 rewrite_module:

    LoadModule rewrite_module modules/mod_rewrite.so
    
    RewriteEngine on
    RewriteCond %{SERVER_PORT} =80
    RewriteRule ^(.*) https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
    

    完整的文档可以在这里找到:https://www.ibm.com/support/pages/node/72233

    【讨论】:

      猜你喜欢
      • 2013-07-01
      • 2020-08-07
      • 2015-11-02
      • 1970-01-01
      • 2017-09-28
      • 1970-01-01
      • 1970-01-01
      • 2011-04-23
      相关资源
      最近更新 更多