【问题标题】:Redirect http to https AWS ELB without hosting ssl certificate on webserver将 http 重定向到 https AWS ELB,而不在网络服务器上托管 ssl 证书
【发布时间】:2015-07-29 23:12:55
【问题描述】:

我有在 AWS ELB 后面运行 nginx 的 Web 服务器。我已将 ELB 设置为接受 https 连接,并通过 http 将请求发送到网络服务器。我还想接受到 ELB 的 http 连接,并将它们重定向到 https。

此重定向问题的所有解决方案都涉及在网络服务器上处理 https 并将其重定向到 http。

有没有办法在不处理网络服务器上的重定向的情况下做到这一点?我宁愿不必在 ELB 和所有网络服务器上拥有我的 ssl 证书。

【问题讨论】:

    标签: redirect ssl amazon-web-services https amazon-elb


    【解决方案1】:

    是的,这很常见。这取决于您的网络服务器是什么,但您要查找 X-Forwarded-Proto 标头。如果设置为http,则重定向用户。

    Here's Amazon's documentation on the X-Forwarded-* headershere's a blog entry talking about one way to implement the forward in nginx

    【讨论】:

    • 博文中解决方案的唯一问题是我必须在我的 nginx 配置中指定我的域名,而不仅仅是 localhost
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-01-23
    • 2021-04-05
    • 2022-08-22
    • 2016-01-15
    • 2012-01-09
    • 1970-01-01
    • 2018-03-07
    相关资源
    最近更新 更多