No subject

m irya xmirya at
Tue May 22 14:52:33 UTC 2012


I'm trying to make nginx mod_zip work with internal http requests
(instead of local files), however somehow the "?" sign in the URL is
being urlencoded, breaking everything. Nginx serves as a proxy for
Apache, and the configuration is straightforward:

location / {
            proxy_redirect     off;

            proxy_set_header   Host             $host;
            proxy_set_header   X-Real-IP        $remote_addr;
            proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;

location /store/ {
            alias /;

Providing the "command" to mod_zip like (for /store/some/file.txt):

da595dd9 23272 %2Fstore%2Fsome%2Ffile.txt some-file.txt

works like expected - i've got a ZIP archive with some-file.txt
inside. However, if i'm trying (for

da595dd9 23272 %2Fthe%2Furl%2Fto%2Fdownload%3Ffile%3Dfile.txt%26another%3Dparam

i've got an empty archive. Exploring the nginx error log i've found
the next statement:

2012/05/22 17:30:45 [error] 5448#0: *20 mod_zip: a subrequest returned
404, aborting... while reading response header from upstream, client:, server:, request: "GET /the/original/url
HTTP/1.1", subrequest:
"/the/url/to/download?file=file.txt&another=param", upstream:
host: ""

As you see, while "subrequest" is correct, in the "upstream" the
question mark was urlencoded for some reason (while "&" and "=" were
not), and the Apache logs confirm the request is incorrect (so
returning 404).

Is there any way to avoid such extra-encoding?

nginx-1.2.0/FreeBSD, mod_zip is the only compiled in module.

More information about the nginx mailing list