Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We have nginx in front of an Apache server in reverse proxy mode.

We initially had Apache compressing files using mod_deflate, however that proved to cause problems with some instances of Internet Explorer. My guess is that there was some strange handling of "vary" responses by nginx and it's proxy cache which triggered the IE problem.

We're now attempting to compress content using nginx itself, so we disabled mod_deflate in Apache, and added the following to the nginx server{} configuration

gzip             on;
gzip_proxied     any;
gzip_types       text/css text/plain text/xml application/xml application/javascript application/x-javascript text/javascript application/json text/x-json;
gzip_vary        on;
gzip_disable     "MSIE [1-6]\.";

This has no effect. The content is always served without gzip compression, as verified using Fiddler.

Things I have tried:

  1. Remove both the gzip_vary and gzip_disable options (the latter being implicated by some other questions on this site).
  2. Move the gzip
  3. settings into the location{} part of the server{} settings. Move the gzip settings before and after location{}

Does anybody have this kind of setup working?

OS: CentOS 2.6.18-274.17.1.el5, nginx version: 1.0.12

share|improve this question

To answer my own question: The problem seemed to be that "nginx reload" didn't cause the setting to take effect. Issuing a full "nginx restart" fixed it.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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