【问题标题】:Forcing HTTP redirect to HTTPS is ignoring subdomains强制 HTTP 重定向到 HTTPS 会忽略子域
【发布时间】:2017-01-24 10:22:31
【问题描述】:

我已经设置了一个 Apache 服务器,其中包含 3 个虚拟主机 tomrouse.medev.tomrouse.meserver.tomrouse.me。所有虚拟主机都运行良好。当我访问每个站点时,它会将我带到该站点的索引。

但是当我添加 SSL 并强制 HTTP 重定向到 HTTPS 时,无论我请求什么子域,它现在总是转到 tomrouse.me 虚拟主机。

我在 Apache 可用站点中的文件:

Apache 的 SSL 配置:

我认为这不是虚拟主机的问题,因为在我使用 python-letsencrypt-apache 程序添加带有重定向的 SSL 之前,一切都运行良好。

【问题讨论】:

    标签: apache redirect ssl https


    【解决方案1】:

    全部修复,我尝试一次在所有子域中安装 ssl 时出错了,完全重新安装,然后一次安装一个,它工作正常!

    例如:

    这是它告诉你的(这不起作用):

    sudo letsencrypt --apache -d tomrouse.me -d dev.tomrouse.me -d server.tomrouse.me
    

    我重新安装了相同的服务器,但是这部分是这样的:

    sudo letsencrypt --apache -d tomrouse.me
    sudo letsencrypt --apache -d dev.tomrouse.me
    sudo letsencrypt --apache -d server.tomrouse.me
    

    并像我以前一样为每个选择强制 https 如果你有相同的 issie,这是一个修复但是如果你已经做了第一种方式,你必须重新启动据我所知,我在第一种方式之后尝试这样做它很有用。

    Correct format of apache config files:

    所有的 ssl 配置文件都应该由 let 加密程序https://www.digitalocean.com/community/tutorials/how-to-secure-apache-with-let-s-encrypt-on-ubuntu-16-04创建

    【讨论】:

      猜你喜欢
      • 2016-11-14
      • 2014-08-15
      • 2020-05-28
      • 1970-01-01
      • 1970-01-01
      • 2016-01-30
      • 1970-01-01
      • 2019-04-20
      • 2020-07-23
      相关资源
      最近更新 更多