I have Nginx setup as a reverse proxy between the world and my app, and it's successfully gzipping the proxied responses of GET requests with this general config:

gzip on;
gzip_min_length 0;
gzip_proxied any;
gzip_buffers 16 8k;
gzip_types application/json text/plain;
proxy_set_header Connection "";
proxy_http_version 1.1;

The browser sends the POST with seemingly the right headers:

Accept: application/json, text/plain, */*
Accept-Encoding: gzip, deflate

However in the response header there's no Content-Encoding even thought it has Content-Type: application/json;charset=UTF-8

Can Nginx gzip the HTTP POST Response?

  • Did you find a solution to this? – d.moncada Aug 27 '18 at 3:41
  • I did not, in the end I decided to compress the response upstream of Nginx where it's generated. I didn't pursue trying to chase down if this is considered a bug in Nginx or not. – Josh Z Sep 1 '18 at 3:06

Your Answer

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

Browse other questions tagged or ask your own question.