首页 文章

Google Cloud HTTP Balancer和gzip

提问于
浏览
7

当我使用谷歌 Cloud 网络负载均衡器时,所有我的HTTP gzip连接保持不变,但在使用HTTP / S Load Balancer时,最终用户不会获得gzip压缩内容 .

我在VM上使用nginx . 使用这个卷曲示例:

curl -H "Accept-Encoding: gzip" -H "Host: my.website.com" -I https://$IP_TO_TEST/login --insecure

当我连接到HTTP负载均衡器时直接连接到VM并且没有gzip时,我得到 Content-Encoding: gzip .

我已经搜索了所有Google Cloud 文档,但他们没有提到它们是否支持或者不从后端压缩内容 .

2 回答

  • 8

    Google Cloud HTTP / S负载均衡器支持来自后端的gzip压缩内容 . 但是,通过负载均衡器代理的请求将添加'Via: google 1.1'标头 . 默认的nginx配置does not trust proxies to be able to handle gzipped responses . 解决方案是启用gzip_proxied .

  • 0

    HTTP / S负载均衡器支持来自后端的gzip压缩内容 . 您是否有可以共享的请求和响应标头的示例?你在VM上运行的是什么(nginx,Apache)?

相关问题