我的 Apache 配置中有以下内容,没有做任何更改,它将在 Apache 2.4.34 中工作,但升级到 2.4.39 后,它开始抛出 Bad Gateway 错误。
在 mod_proxy.c 下
ProxyPass /reports http://domainname:10080/reports/
ProxyPassReverse /reports http://domainname:10080/reports/
代理配置相对简单,所以我不确定我是否遗漏了什么,或者 mod_proxy.c 上是否做了一些重要的更改,需要更新。但是从官方网站和教程来看,这是最简单的了。
日志(IP 信息已删除,其余信息相同)
[Wed Sep 04 11:36:09.191115 2019] [proxy:debug] [pid 2574:tid 47621331556672] proxy_util.c(2887): AH02824: HTTP: connection established (Redacted)
[Wed Sep 04 11:36:09.191144 2019] [proxy:debug] [pid 2574:tid 47621331556672] proxy_util.c(3054): AH00962: HTTP: connection complete to (Redacted)
[Wed Sep 04 11:36:09.191154 2019] [ssl:info] [pid 2574:tid 47621331556672] [remote (Redacted):10080] AH01964: Connection to child 0 established (server (Redacted):443)
[Wed Sep 04 11:36:15.911147 2019] [ssl:debug] [pid 2574:tid 47621331556672] ssl_engine_io.c(1372): (70014)End of file found: [remote (Redacted):10080] AH02007: SSL handshake interrupted by system [Hint: Stop button pressed in browser?!]
[Wed Sep 04 11:36:15.911200 2019] [ssl:info] [pid 2574:tid 47621331556672] [remote (Redacted):10080] AH01998: Connection closed to child 0 with abortive shutdown (server (Redacted):443)
[Wed Sep 04 11:36:15.911236 2019] [proxy:error] [pid 2574:tid 47621331556672] (70014)End of file found: [client (Redacted):59814] AH01084: pass request body failed to (Redacted):10080
[Wed Sep 04 11:36:15.911250 2019] [proxy_http:error] [pid 2574:tid 47621331556672] [client (Redacted):59814] AH01097: pass request body failed to (Redacted):10080 ((Redacted)) from (Redacted) ()
谢谢
Server version: Apache/2.4.39 (Unix)
Server built: Apr 5 2019 15:50:24
Server's Module Magic Number: 20120211:84
Server loaded: APR 1.6.2, APR-UTIL 1.6.0
Compiled using: APR 1.6.2, APR-UTIL 1.6.0
Architecture: 64-bit
Server MPM: event
threaded: yes (fixed thread count)
forked: yes (variable process count)
更新 我可以确认该问题仅仅是由于模块 mod_proxy.so 引起的,因为我用旧的 apache 版本替换了这个特定的模块,并且它可以正常工作。
从变更日志来看,https://www.apachelounge.com/Changelog-2.4.html 我看到了以下内容,不确定这是否是问题所在(版本 2.4.38)
“mod_proxy:如果使用 ProxyPassReverse 进行相对重定向的反向映射,则后续的 ProxyPassReverse 语句(无论是相对的还是绝对的)都可能失败。PR 60408。[Peter Haworth < pmh1wheel gmail.com>]”