I got an issue with a filename containing “strange” characters.
It seems that nginx is not able to url_decode correctly, and then get
the
right file.
Yes, the filename is ugly : “Capture dcran 2010-09-25 08.30.07.png”
but apache is able to read it, and nginx is not :
nginx strace :
open("//images/Capture%20d%E2%80%99%C3%A9cran%202010-09-25%20%C3%A0%2008.30.07.png",
O_RDONLY|O_NONBLOCK) = -1 ENOENT (No such file or directory)
Hum… well ok, if I read it right, it is recommanded to use try_files
instead right ?
Problem is that it seems that try_files is not allowed inside a “if”…
Well… maybe someone will be able to point me a better conf, here what
I’m
trying to do :
location ~ ^/(media|files|list|album|images)/ {
root /;
if ($host ~* "^(.)(.)(.*)\.example.com$") {
set $dir1 $1;
set $dir2 $2;
set $dir3 $3;
rewrite ^ /<path>/
So I should be able to remove the if so try_files might be happy, but I
do
not know how to set the 3 dir w/o the if statement…
I tried several things, so far no luck.
On Tue, Nov 13, 2012 at 10:22:53AM +0100, Nilshar wrote:
I got an issue with a filename containing “strange” characters.
apache strace :
configuration into nginx, but no luck…
Yes indeed, there is a rewrite !
Well… maybe someone will be able to point me a better conf, here what I’m
}
}
So I should be able to remove the if so try_files might be happy, but I do
not know how to set the 3 dir w/o the if statement…
I tried several things, so far no luck.
server {
server_name ~^(?.)(?.)(?.*).example.com$;