问题描述
我将Apache Http服务器版本2.4配置为后端服务器(实际上是Glasfish App Server)的代理.MPM是 worker
.
I configured Apache Http server version 2.4 as proxy for backend server (Glassfish App Server actually). MPM is worker
.
大多数情况下,配置为默认设置.代理配置
Configuration is mostly default. Configuration for proxy
ProxyPass /context/ http://backend.com:8080/context/ keepalive=On ttl=25 timeout=300 max=50
ProxyPassReverse /context/ http://backend.com:8080/context/
我在浏览器中打开页面,它向Apache发送 GET http://example.com/context HTTP/1.1
.Apache返回带有 Connection:close
标头的响应 HTTP/1.0 200 OK
.但是实际的后端服务器响应包含 HTTP/1.1 200 OK
.
I open page in browser and it sends GET http://example.com/context HTTP/1.1
to Apache. Apache returns response HTTP/1.0 200 OK
with Connection: close
header. But actual backend server response contains HTTP/1.1 200 OK
.
为什么Apache将代理响应从1.1降级到1.0?
Why does Apache downgrade proxied response from 1.1 to 1.0?
推荐答案
force-no-vary
是原因.文档说:
force-response-1.0 这会强制HTTP/1.0响应客户端HTTP/1.0请求.它最初是由于AOL代理的问题.某些HTTP/1.0客户端可能无法正常运行在给出HTTP/1.1响应时正确显示,并且可以用来与他们进行互操作.
force-response-1.0 This forces an HTTP/1.0 response to clients making an HTTP/1.0 request. It was originally implemented as a result of a problem with AOL's proxies. Some HTTP/1.0 clients may not behave correctly when given an HTTP/1.1 response, and this can be used to interoperate with them.
这篇关于即使请求为http/1.1,Apache也会使用http/1.0进行响应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!