nginx-buildpack icon indicating copy to clipboard operation
nginx-buildpack copied to clipboard

gzip doesn't work

Open polyrabbit opened this issue 10 years ago • 3 comments

Hey all, Thanks for your work!

I'm having trouble getting gzip to work on heroku. Here is my nginx config file and here is my web app deployed on heroku http://o.hackernews.im and my test command curl -I -v -H "Accept-Encoding: gzip,deflate" http://o.hackernews.im

The weird thing is with the same config file and same run command, I can get a gzipped response from my development environment, but when deployed on heroku, no matter how hard I try, I just cannot get the response gzipped. Any one else has the same problem with me?

polyrabbit avatar Dec 16 '14 01:12 polyrabbit

Hi,

I can confirm that nginx is not gzipping the response on Heroku, although gzip is on in the conf file.

mokibenjak avatar Mar 05 '15 14:03 mokibenjak

If you solved this issue please tell me how ??

vaibhav-jain avatar Feb 05 '16 19:02 vaibhav-jain

I was inspired by another nginx-like buildpack heroku-buildpack-static which is working perfect with gzip on. Copying its gzip config and replace ourselve' will fix this issue:

  gzip on;
  gzip_comp_level 6;
  gzip_min_length 512;
  gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
  gzip_vary on;
  gzip_proxied any;

Hope this helps.

AndreLion avatar Jul 08 '17 16:07 AndreLion