Sending pre-compressed data via nginx

Igor Sysoev is at rambler-co.ru
Thu Aug 31 09:11:04 MSD 2006


On Thu, 31 Aug 2006, Yusuf Goolamabbas wrote:

> Hi, I wasn't able to figure out if it's possible to send out
> precompressed (gzipped data) via nginx
> It just needs to add Content-Encoding: gzip to the response header
>
> I'm looking for something similar to what can be done in lighttpd
>
> http://trac.lighttpd.net/trac/wiki/Docs%3AModSetEnv

Currently it's easy to do only if you can easy separate locations:

      location / {
          root  /path/to/files;
      }

      location ~* "(README|ChangeLog|\.txt)\.gz$" {
          root  /path/to/files;

          add_header  Content-Encoding  gzip;

          # turn off on the fly gzip compression, because
          # it does not currently check header set by "add_header"
          gzip off;

          # nginx set type according last suffix only
          type { text/plain gz }
      }


Igor Sysoev
http://sysoev.ru/en/





More information about the nginx mailing list