为什么必须在AWS Application Load Balancer中禁用HTTP/2才能防止ERR_SPDY_PROTOCOL_ERROR? [英] Why did I have to disable HTTP/2 in AWS Application Load Balancer to prevent ERR_SPDY_PROTOCOL_ERROR?

本文介绍了为什么必须在AWS Application Load Balancer中禁用HTTP/2才能防止ERR_SPDY_PROTOCOL_ERROR?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我使用应用程序负载平衡器(ALB)将Web应用程序部署到AWS环境时,某些Web服务终端节点将不返回任何数据,并且我的Chrome浏览器将针对某些错误报告此错误. http调用: ERR_SPDY_PROTOCOL_ERROR

When I deployed my web application to an AWS environment with an Application Load Balancer (ALB), some of my web service endpoints would not return any data and my Chrome browser would report this error for some http calls: ERR_SPDY_PROTOCOL_ERROR

在找到此建议后,我在ALB配置中禁用了 HTTP/2 支持,并且现在一切正常.

Upon finding this recommendation, I disabled HTTP/2 support in my ALB configuration and everything works now.

为什么必须在ALB中禁用 HTTP/2 ?这里的根本问题是什么?我是否需要更改Web服务代码中的某些内容,以便可以使用 HTTP/2 ?

Why did I have to disable HTTP/2 in my ALB? What is the root issue here? Do I need to change something in my web service code so that I can use HTTP/2?

更新

以下是响应标头:

HTTP/1.1 200
Date: Wed, 09 Jan 2019 21:39:13 GMT
Content-Type: application/json;charset=UTF-8
Transfer-Encoding: chunked
Connection: keep-alive
Locations Reached: Data to populate locations reached map

正如以下答案之一所暗示的,罪魁祸首可能是我的标头之一(到达的位置")的名称中有一个空格,该空格无效/格式错误.我将确保用破折号代替空格.

As suggested by one of the answers below, the culprit is probably the fact that one of my headers (Locations Reached) has a space in the name, which is invalid/malformed. I'll make sure that space gets replaced by a dash.

推荐答案

通常意味着您拥有无效的HTTP/2标头.在这方面,HTTP/2比HTTP/1.1更严格.

Usually means you have an invalid HTTP/2 header. HTTP/2 is more strict than HTTP/1.1 in this regard.

因此,名称中带有冒号,空格,换行符的HTTP标头名称(例如,在引用中打开引号但忘记关闭引号)等无效(这些标头值可以存在于标头值中,但不能存在于名称中)

So HTTP header names with colons, spaces, new lines (e.g. opening quotes but forgetting to close the quotes in your config) and the like in the name are invalid (these can exist in the header values but not in the names).

有关调试的详细信息,请参见此处: https://www.michalspacek.com/chrome-err_spdy_protocol_error-and-an-invalid-http-header .

See here for details on how to debug: https://www.michalspacek.com/chrome-err_spdy_protocol_error-and-an-invalid-http-header.

在您的问题中添加HTTP/1.1响应标头,也许可以为您指明正确的方向.

Add your HTTP/1.1 response headers to your question and might be able to point you in the right direction.

这篇关于为什么必须在AWS Application Load Balancer中禁用HTTP/2才能防止ERR_SPDY_PROTOCOL_ERROR?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆