IPhone / iPad 不会加载 AWL ELB 后面的网站或子域托管

IPhone / iPad will not load website or subdomain hosting behind a AWL ELB

我 运行 遇到了一个难题,即在 AWS 上的 ELB 后面的 EC2 实例上托管的网站无法加载到任何移动 I 设备上。该站点在桌面上的所有浏览器上加载正常。

我的 EC2 是 运行 Centos 和 Apache。

没有错误消息,Safari 只是显示一个空白页面,地址栏会被清除。 Chrome 显示消息 "ERR_FAILED"。

我被这个问题困扰了好几天,在网上找不到太多所以我想分享我的解决方案。

我发现 运行

curl "https://example.com" 

返回

HTTP/2 stream 0 was not closed cleanly: PROTOCOL_ERROR (err 1)

经过更多研究,我发现

Application Load Balancers provide native support for HTTP/2 with HTTPS listeners. You can send up to 128 requests in parallel using one HTTP/2 connection. The load balancer converts these to individual HTTP/1.1 requests and distributes them across the healthy targets in the target group. Because HTTP/2 uses front-end connections more efficiently, you might notice fewer connections between clients and the load balancer. You can’t use the server-push feature of HTTP/2. [source]

解决方法:编辑http.conf禁用HTTP/2

改变

Protocols h2 h2c http/1.1

Protocols http/1.1