This is the last version of the patch for version 0.8.52 which is now live on our production servers for several days without any flaws. http://www.coderain.de/nginx/nginx-0.8.52-xred.patch The escaping takes place at ngx_http_parse_unsafe_uri() as Maxim suggested. best regards volkerby rovervr - Nginx Mailing List - English
This patch is wrong, it breaks access to normal files with '%'. This code fixes the double encoding issue while serving static files without X-Accel-Redirect as stated by Maxim --- /tmp/nginx-0.8.50orig/src/http/modules/ngx_http_static_module.c 2010-05-24 14:35:10.000000000 +0200 +++ ngx_http_static_module.c 2010-09-09 20:23:29.000000000 +0200 @@ -47,7 +47,7 @@ static ngx_by rovervr - Nginx Mailing List - English
Hi Maxim, Additionally, it doesn't change X-Accel-Redirect behaviour for non-static files. Don't get me wrong .. but isn't X-Accel-Redirect for serving static files without the overhead of php-fpm/fastcgi? Can you provide an example where X-Accel-Redirect is used for dynamic files? The patch works for me because I just use nginx to serve download files, but I'd like to provide aby rovervr - Nginx Mailing List - English
If you'd use an url with a filename that contains an '%' the client should always encode it to '%25' which would get decoded correctly in this case. In RFC1738 the '%' is an "Unsafe Character" and should always be encoded in URIs The check could be extended to something like %({2}) but directories or files like %ears or %b1blabla would fail that check, too.by rovervr - Nginx Mailing List - English
Hi, I created a small patch for that issue which works for me. But it needs to be reviewed by Igor or someone who knows C better than me. It checks the static request from X-Accel-Redirect for '%' and escapes them if found. --- nginx-0.8.50orig/src/http/modules/ngx_http_static_module.c 2010-05-24 14:35:10.000000000 +0200 +++ nginx-0.8.50/src/http/modules/ngx_http_static_module.c 20by rovervr - Nginx Mailing List - English
Hi everyone, I got a server which serves Data to a client ( in my case MP3s ). The MP3s are saved in a storage directory in the form Artist - Title.mp3 I'm using X-Accel-Redirect to serve the files from the storage dir to the user. This workes fine for most cases but fails for special chars like the question mark. I already tried encoding it - but the char always gets stripped like in Queryby rovervr - Nginx Mailing List - English