jordi
jordi

Reputation: 3721

Google Cloud HTTP Balancer and gzip

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.

Upvotes: 11

Views: 4843

Answers (2)

Matt S.
Matt S.

Reputation: 7881

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.

Upvotes: 16

Matt S.
Matt S.

Reputation: 7881

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

Upvotes: 0

Related Questions