apache - 带有 Apache 反向代理 http2 的 NGINX 网络服务器
问题描述
我已将我的 Apache 配置为反向代理。现在我想启用 http2 来加速它。
Apache 已启用该模块,Nginx 也已启用。
当我进入
Protocols h2 h2c http/1.1
ProtocolsHonorOrder Off
ProxyPass / h2://192.168.2.100/
ProxyPassReverse / https://192.168.2.100/
进入 apache 站点配置,Nginx 抛出 400 Bad Request Error。
改为使用此代码:
Protocols h2 h2c http/1.1
ProtocolsHonorOrder Off
ProxyPass / https://192.168.2.100/
ProxyPassReverse / https://192.168.2.100/
Nginx 配置:
listen 443 ssl http2;
我需要如何配置此部分才能正常工作?#
解决方案
我意识到这篇文章已经有一年多了,但是在将 nginx 升级到 1.20.1 后我遇到了类似的问题。事实证明,当使用 HTTP2 时,nginx 正在从 Apache 接收多个 Host 标头。添加 RequestHeader unset Host 解决了这个问题。
推荐阅读
- c - (C DSA) 为什么在 fgetc() 读取并搜索时,使用 fputc() 写入的字符位置偏移 1?
- python - Discord.py 中 cog 的延迟未被识别为有效属性
- android - Android ListView FindViewById 混淆
- python - 在服务器上无限运行 python 脚本
- javascript - 如何保存此表单以备后用,以 JSON 格式存储序列化数据?
- javascript - 当值未定义时,保持输入状态会中断应用程序
- javascript - 如何检查最近用jquery悬停的元素
- git - 错误:将“.git”转换为绝对错误:访问被拒绝
- scala - Scala:Nothing 和 throw 表达式
- c# - 如何从另一个脚本获取游戏对象位置