Problem with the lack of url encoding in the rewrite result url

Alexander Radostin alex.radostin at gmail.com
Tue Dec 29 00:38:36 MSK 2009


Hi everyone!

Recently we've moved from lighttpd to nginx and I've discovered a problem
with the different rewrite handling in nginx.

The rule:

rewrite ^/download/([^/]+)/(.+)/$
/index.php/download/?hash=$1&filename=$2        last;

works fine, but the $1 and $2 args in the result url are not url encoded and
sometimes we have "&" in the filenames which brakes the resulting query
string by cutting the file name and adding another variable. Encoding & as
%26 in the source url doesn't help. Is there a way to enable url encoding of
the args for the result url?

***
Alexander Radostin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nginx.org/pipermail/nginx/attachments/20091228/efc3211c/attachment.html>


More information about the nginx mailing list