Google Cloud HTTP Balancer and gzip

时间秒杀一切 提交于 2019-12-10 13:06:42

问题


When i was using Google Cloud Network Load Balancer all my HTTP gzip connections where left intact, but when using HTTP/S Load Balancer end users don't get the gzipped content.

I'm using nginx on the VM. Using this curl example:

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

I get Content-Encoding: gzip when connecting direct to the VM and no gzip when I connect to the HTTP load balancer.

I've searched all the Google cloud documentation for this and they don't mention whether they support or don't gzipped content from backends.


回答1:


The Google Cloud HTTP/S load balancer supports gzipped content from backends. However, requests proxied through the load balancer will have a 'Via: google 1.1' header added. The default nginx configuration does not trust proxies to be able to handle gzipped responses. The solution is to enable gzip_proxied.




回答2:


The HTTP/S load balancer supports gzipped content from backends. Do you have an example of request and response headers you could share? What are you running on the VM (nginx, Apache)?



来源:https://stackoverflow.com/questions/35947469/google-cloud-http-balancer-and-gzip

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!