【问题标题】:Redirection https to https within same Apache在同一个 Apache 中将 https 重定向到 https
【发布时间】:2016-03-06 17:10:18
【问题描述】:

我有一个要求,我必须将我的主机名重定向到再次托管在同一个 Apache 上的特定应用程序。举个例子,当我点击主机(https://domain1.example.com)时,它应该在内部将我重定向到 Apache Web 应用程序(https://domain1.example.com/application1)而不更改浏览器 URL。

我不确定如何实现 SSL 到 SSL 的重定向。提前致谢..!!!

【问题讨论】:

  • 如果您只想要 internal 重定向,那么 SSL 与此有什么关系?
  • 我有一个我在 DocumentRoot PATH_TO_APP 中设置的应用程序,我希望所有主机都指向同一个应用程序,即 domain1.example.com 或 domain2.example.com 或 domainN.example.com 应该是能够访问我的应用程序(domain.example.com)..
  • 这仍然不能解释 SSL/HTTPS 与此有什么关系——如果您的重定向只是内部
  • 抱歉,我想我没听懂你的问题。我的整个 Apache 设置都在 HTTPS 上。
  • ... 没关系,因为你只想重定向内部,这意味着客户端不会发出新的请求。

标签: apache redirect ssl shibboleth


【解决方案1】:

这应该可行。这会将所有进入 domain1.example.com/ 的传入 url 重定向到 domain1.example.com/application1

RewriteEngine On
RewriteCond %{HTTP_HOST} ^domain1.example.com$
RewriteRule ^$ https://domain1.example.com/application1 [L,R=301]

【讨论】:

    【解决方案2】:

    如果不更改浏览 URL 是您的目标,那么 PROXY 就是您的方式。

    将以下内容放入您的 apache vhost 或全局文件中,

    ProxyPass https://domain1.example.com/ https://domain1.example.com/application1
    ProxyPassReverse https://domain1.example.com/ https://domain1.example.com/application1
    

    PS shibboleth 与此无关,至少你没有提到任何案例。

    编辑

    1. ProxyPass 应该来到不在location 中的虚拟主机

    2. 理想情况下,所有location 标记都应在virtual host 之外

    【讨论】:

    • DocumentRoot "E:\projects\project\deliverables\RFNG\rf-iam" ServerName domain1.example.com SSLProxyEngine On SSLCertificateFile "C:\Apache24\certificates\idp. crt" SSLCertificateKeyFile "C:\Apache24\certificates\idp.key" AuthType shibboleth ShibUseHeaders On ShibRequestSetting applicationId iam ProxyPass domain.example.com/iam ProxyPassReverse domain.example.com/iam ShibRequestSetting requireSession true 需要有效用户 我不确定,我在这里错过了什么:(
    • 我不明白你为什么需要 shibboleth!
    • 这样只有注册用户才能访问应用程序。
    猜你喜欢
    • 2011-08-18
    • 1970-01-01
    • 2018-08-03
    • 1970-01-01
    • 2016-02-25
    • 2019-11-08
    • 2017-09-28
    • 2013-08-20
    • 1970-01-01
    相关资源
    最近更新 更多