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

I know that you can use nginx HttpGzipModule to gzip responses. Can you als use it to enable nginx to handle gzip-compressed requests, i.e. ones with the request header: Content-Encoding: gzip ?

Note: Apache, with the help of mod_deflate can handle gzip-compressed requests with the directive SetInputFilter DEFLATE.



share|improve this question

1 Answer 1

I just tried this on an nginx server I have sitting in front of an Apache backend.

curl -H "Content-Encoding: gzip" --include -d @testfile.gz http://example.com/upload_file.php

curl automatically added:

Expect: 100-continue

to the request headers.

nginx sent back a

HTTP/1.1 100 Continue

response and curl followed up by sending the gzipped data. nginx passed the whole lot back to Apache, still compressed and still with the Content-Encoding: header intact.

If I didn't add the Content-Encoding: gzip header with curl, I didn't get the HTTP 100 response but everything else was the same.

This doesn't answer your question yet but it does imply that nginx either doesn't handle this by default or doesn't uncompress the body of the request when it is proxying. I'm interested in the answer to this one so I'll see if I can try it out on a non-proxying nginx server a bit later on.

Presumably you could solve the bandwidth problem by proxying those requests to an Apache backend with mod_deflate but that ignores the reason you chose nginx in the first place.

share|improve this answer
Thanks. Have you tried on a non-proxying nginx server? –  MattDiPasquale Apr 21 '12 at 22:27

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.