ryandotsmith / nginx-buildpack

Run NGINX in front of your app server on Heroku
457 stars 248 forks source link

gzip doesn't work #43

Open polyrabbit opened 9 years ago

polyrabbit commented 9 years ago

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?

mokibenjak commented 9 years ago

Hi,

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

vaibhav-jain commented 8 years ago

If you solved this issue please tell me how ??

AndreLion commented 7 years ago

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.