We have a set of servers in AWS that are behind an ELB. We are trying to upload data to the server. We want to enable gzip, but the servers themselves use an obscure golang framework that does not have default gzip support to uncompress incoming requests.

Is it possible to terminate gzip at a load balancer, and send uncompressed content to the servers behind them?

That way our clients can send gzipped data, and we don't have to modify the server code.


No, AWS load balancers do not support compressing or decompressing data streams.

However, CloudFront does. Adding CloudFront in front of your load balancer improves performance and security.

Here is a link regarding CloudFront and Gzip:

Gzip Compression Support for Amazon CloudFront

  • Does that work both ways? Uploads and downloads? – Jason Jul 15 '18 at 12:00
  • If the client (web browser) sends data gzip compressed, CloudFront would pass the data to your backend gzip compressed. CloudFront will not gzip compress the client data before sending to your backend. – John Hanley Jul 15 '18 at 17:25
  • I need it to unzip gzipped data as the server code will not support gzip post requests. Trying to reduce client upload data. – Jason Jul 16 '18 at 14:18
  • Few clients are going to gzip POST/PUT requests. If they do, the header Content-Encoding will be set. The load balancer will pass the data and this header unchanged back to your server. One of the reasons that the load balancer will NOT decompress your data is due to security issues like "Zip Bomb" where a small compressed request becomes a huge data stream decompressed. – John Hanley Jul 16 '18 at 16:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.