apache - 如何在 Apache 2.4.1 中与 Haproxy 一起使用 mod_deflate?

标签 apache haproxy mod-deflate

我有一个奇怪的问题,在我的 Apache 2.4.1 httpd.conf 中包含以下语法会在通过 HAproxy 检索 swf 文件时导致“502 Bad Gateway”错误:

AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/x-javascript text/javascript

当我删除此配置行时,502 Bad Gateway 错误就会消失。

服务器在成功请求时返回这些响应 header :

Date: Wed, 11 Apr 2012 20:24:12 GMT
Server: Apache
Connection: close
Transfer-Encoding: chunked
Content-Type: text/html; charset=utf-8

200 OK

最佳答案

我通过更新到 Apache 2.4.2(2.4.1 中存在 mod_deflate seg 错误错误)并添加以下内容修复了此问题:

header 附加不同的用户代理

AddOutputFilterByType 行下方。

关于apache - 如何在 Apache 2.4.1 中与 Haproxy 一起使用 mod_deflate?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10113454/

相关文章:

apache - 使 RewriteRule 可移植/相对于 .htaccess 文件的目录

php - 如何在ssh中使用pid查看正在运行的后台任务

load-balancing - 负载平衡(HAProxy 或其他) - 粘性 session

nginx - 如何负载均衡容器?

elasticsearch - Elasticsearch 7.3 Rest客户端是否发现新节点?

php - mod_deflate 和 zlib output_compression 的区别

apache - Kerberos 升级

apache - 我如何在 Apache 的 mod_proxy 后面使用密码保护应用程序?

json - 启用 mod_deflate 时,Apache 2.4.7 未发送 304 响应

apache - mod_deflate 与 mod_gzip