nginx is not using gzip to talk to backend servers

Posted by Michael Gorsuch on Server Fault See other posts from Server Fault or by Michael Gorsuch
Published on 2010-05-16T12:59:40Z Indexed on 2010/05/16 13:10 UTC
Read the original article Hit count: 333

Filed under:
|

Our web servers are running IIS 7 and are configured to compress dynamic and static content. When I hit these servers directly, gzip compression works.

I recently placed nginx in front of them, and gzip compression has stopped. I was able to work around this by explicitly enabling gzip compression on nginx itself, but that seems a little inefficient considering I have half a dozen backends and only one active nginx box.

It appears that nginx is stripping out the Accept-Encoding header. Does anyone have any advice for how to 'correct' this behavior?

A sample configuration:

upstream backend {
  server 127.0.0.1:8080;
}

server {
  listen   80;
  proxy_set_header        Host            $host;
  proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;

  location / {
    proxy_pass http://backend;
  }
}

© Server Fault or respective owner

Related posts about nginx

Related posts about gzip