gpt4 book ai didi

将 http 重定向到 https AWS ELB 而无需在网络服务器上托管 ssl 证书

转载 作者:太空宇宙 更新时间:2023-11-03 13:16:46 27 4
gpt4 key购买 nike

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

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

有没有办法在不处理网络服务器上的重定向的情况下执行此操作?我宁愿不必在 ELB 和所有网络服务器上拥有我的 ssl 证书。

最佳答案

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

Here's Amazon's documentation on the X-Forwarded-* headers , 和 here's a blog entry talking about one way to implement the forward in nginx .

关于将 http 重定向到 https AWS ELB 而无需在网络服务器上托管 ssl 证书,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31712703/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com