Google Cloud HTTP Balancer and gzip

2019-06-17 18:21发布

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.

2条回答
我想做一个坏孩纸
2楼-- · 2019-06-17 18:53

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)?

查看更多
老娘就宠你
3楼-- · 2019-06-17 19:08

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.

查看更多
登录 后发表回答