Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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>
share|improve this question
add comment

1 Answer 1

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

share|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
add comment

Your Answer

 
discard

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.