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

I have a folder full of .gz files and would like to serve them transparently inflated if requested by a client that does not send Accept-Encoding: gzip in the request and as-is (gzip'd) otherwise.

I know there is the HttpGzipStaticModule module, but that only solves one part of the problem. The files will only be stored as .gz, so there won't be an inflated version there for nginx on the file system. This shouldn't be a performance issue, since inflate is fairly light on CPU and RAM.

What method can I use to inflate the .gz file on-the-fly and serve it back to the client? Do I have to script it and use a rewrite or is there something builtin that I just haven't found as of yet?

share|improve this question
You store the gunzipped files as well, or you write your own "GunzipStatic" module. – Michael Hampton Mar 20 '13 at 19:35

Your Answer


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

Browse other questions tagged or ask your own question.