简体   繁体   English

通过应用程序负载平衡器将HTTP重定向到https不能在iPhone Safari中使用

[英]http to https redirect via application load balancer not working in iphone safari

We are doing a redirect from http to https on our AWS application load balancer that works great in most browsers, but doesn't work in safari in an iphone. 我们正在AWS应用程序负载平衡器上执行从http到https的重定向,该重定向在大多数浏览器中都很好用,但在iPhone的Safari浏览器中不起作用。 The redirect is implemented as outlined here https://www.fischco.org/technica/2018/aws-alb-redirects/ 重定向是按照此处概述的方式实现的https://www.fischco.org/technica/2018/aws-alb-redirects/

In safari, our site works perfectly in an iphone when you load it via https, but when you don't include a protocol or use http, it says "Safari could not open the page because the server stopped responding." 在safari中,当您通过https加载我们的网站时,我们的网站可以在iPhone上完美运行,但是当您不包含协议或使用http时,它表示“ Safari无法打开页面,因为服务器停止了响应。”

Any ideas on how to fix this without doing client-side redirection? 关于如何在不进行客户端重定向的情况下解决此问题的任何想法?

This seems to be an Apache bug ( https://bz.apache.org/bugzilla/show_bug.cgi?id=59311 ), for which a solution can be found here: https://serverfault.com/questions/937253/https-doesnt-work-with-safari (check out Steffen Ullrich's answer and the comments) 这似乎是一个Apache错误( https://bz.apache.org/bugzilla/show_bug.cgi?id=59311 ),可以在这里找到解决方案: https : //serverfault.com/questions/937253/ https-doesnt-work-with-safari (查看Steffen Ullrich的回答和评论)

TL;DR; TL; DR;

Add this to your host config 将此添加到您的主机配置

Header unset Upgrade

OR alternatively, add this to your .htaccess file (see Disable Apache http2 announce via htaccess ) 或者,也可以将其添加到您的.htaccess文件中(请参阅通过htaccess禁用Apache http2发布

Header edit Upgrade (.*)h2,h2c(.*) "$1$2"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM