I have a bunch of gzipped log files I'd like to serve with nginx. I want them to served in such a way that they're automatically inflated by the browser. I assume that means I need nginx to send the files as .gz with a text/plain header. This can be done in apache with something like:

<FilesMatch *.gz>
    ForceType text/plain
</FilesMatch>
link|improve this question
feedback

1 Answer

You need the HttpGzipStatic module for this. Put gzip_static on; in your config and create your .gz files. You will need to keep both the zipped and the original file, you can then request, for example, /css.css and be served the zipped /css.css.gz

link|improve this answer
One minor note: it's suggested that both files' modification times (mtime) are the same. – Alexander Azarov Mar 1 '11 at 18:09
feedback

Your Answer

 
or
required, but never shown

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