Welcome! Log In Create A New Profile

Advanced

(no subject)

m irya
May 22, 2012 10:54AM
Hi,

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_pass http://127.0.0.1:8080;
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 /;
internal;
}

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
/the/url/to/download?file=file.txt&another=param):

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

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:
127.0.0.1, server: server.name, request: "GET /the/original/url
HTTP/1.1", subrequest:
"/the/url/to/download?file=file.txt&another=param", upstream:
"http://127.0.0.1:8080/the/url/to/download%3ffile=file.txt&another=param",
host: "server.name"

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.

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

(no subject)

m irya May 22, 2012 10:54AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 257
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready