【问题标题】:Nginx (1.2.7) redirect HTTP to HTTPSNginx (1.2.7) 将 HTTP 重定向到 HTTPS
【发布时间】:2014-10-11 10:50:58
【问题描述】:

在我的服务器上安装了 http Nginx 版本:1.2.7

今天我开启了 SSL。

但是我有个大问题,不知道怎么设置绝对所有子页面永久跳转到:https://example.com

所以我想要这一切:

  • http://example.com
  • http://www.example.com

被重定向到https://example.com

  • http://www.example.com/test.pdf 被重定向到https://example.com/test.pdf

喜欢所有子页面(我有 500 个子页面 200 html - 300 pdf)。

在我的 https 安装的 Apache 上。

还有怎么配置一切,因为我知之甚少。

【问题讨论】:

标签: http redirect ssl nginx https


【解决方案1】:

试试这个:返回 301 https://example.com$request_uri;

【讨论】:

    猜你喜欢
    • 2011-03-29
    • 2018-01-05
    • 1970-01-01
    • 2018-08-18
    • 2017-02-25
    • 1970-01-01
    • 2014-05-08
    • 2015-08-26
    • 1970-01-01
    相关资源
    最近更新 更多