mod_zip usage - invalid file list from upstream

sdee nginx-forum at nginx.us
Wed Oct 3 01:13:29 UTC 2012


I have now solved this issue, so for anyone elses benefit the problem was
due to this issue reported in the link below.

http://code.google.com/p/mod-zip/issues/detail?id=5

Basically if you use a browser (Chrome/Firefox etc) it sets the
"Accept-Encoding: gzip,deflate,sdch" HTTP header which nginx forwards when
proxying to the upstream Apache server that is generating the zip file list
in PHP.  This causes Apache to return the zip file list gzip encoded so
mod_zip can't read it.

When testing with curl or wget it works without issue as these command line
tools don't set a "Accept-Encoding" HTTP header.

To fix this problem I added to the nginx config file the proxy_set_header
option as seen below.


 location ~ \.php$ {
        proxy_pass   http://74.112.172.198:82;
        proxy_redirect off;
        proxy_set_header  Accept-Encoding identity;
 }

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,230510,231345#msg-231345



More information about the nginx mailing list