On 13 November 2012 09:38, Igor Sysoev <span dir="ltr"><<a href="mailto:igor@sysoev.ru" target="_blank">igor@sysoev.ru</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div style="word-wrap:break-word"><div><div class="h5"><div><div>On Nov 13, 2012, at 12:32 , Nilshar wrote:</div><br><blockquote type="cite"><span style="font-family:arial,sans-serif;font-size:13px">Hello list,</span><div style="font-family:arial,sans-serif;font-size:13px">
<br></div><div style="font-family:arial,sans-serif;font-size:13px">I got an issue with a filename containing "strange" characters.</div>
<div style="font-family:arial,sans-serif;font-size:13px">It seems that nginx is not able to url_decode correctly, and then get the right file.</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">
Yes, the filename is ugly : "Capture d’écran 2010-09-25 à 08.30.07.png"</div><div style="font-family:arial,sans-serif;font-size:13px">but apache is able to read it, and nginx is not :</div><div style="font-family:arial,sans-serif;font-size:13px">
<br></div><div style="font-family:arial,sans-serif;font-size:13px">nginx strace :</div><div style="font-family:arial,sans-serif;font-size:13px">open("/<path>/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)</div>
<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">apache strace :</div><div style="font-family:arial,sans-serif;font-size:13px">open("/<path>/images/Capture d\342\200\231\303\251cran 2010-09-25 \303\240 08.30.07.png", O_RDONLY|O_CLOEXEC) = 100</div>
<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">So it seems that nginx is using the url_encoded version of the filename, while apache do it's own thing on it.</div>
<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">On both apache and nginx, the access log says : "GET /images/Capture%20d%E2%80%99%C3%A9cran%202010-09-25%20%C3%A0%2008.30.07.png"</div>
<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">both server have the same locales settings, and I tried different charset configuration into nginx, but no luck..</div>
<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">Any idea how I can fix that without changing the filename (sadly, it's not possible :/) ?</div>
</blockquote></div><div><br></div></div></div>The most probably there is a rewrite in configuration which changes URI to $request_uri.<div>nginx escapes URI if no one interferes.<br><div><div><br><div>
<span style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;border-collapse:separate;text-transform:none;font-size:medium;white-space:normal;font-family:Georgia;word-spacing:0px"><span style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;border-collapse:separate;text-transform:none;font-size:medium;white-space:normal;font-family:Georgia;word-spacing:0px"><div style="word-wrap:break-word">
<span style="text-indent:0px;letter-spacing:normal;font-variant:normal;font-style:normal;font-weight:normal;line-height:normal;border-collapse:separate;text-transform:none;font-size:medium;white-space:normal;font-family:Georgia;word-spacing:0px"><br>
--<br>Igor Sysoev<br></span></div><div style="word-wrap:break-word"><span style="text-indent:0px;letter-spacing:normal;font-variant:normal;font-style:normal;font-weight:normal;line-height:normal;border-collapse:separate;text-transform:none;font-size:medium;white-space:normal;font-family:Georgia;word-spacing:0px"><a href="http://nginx.com/support.html" target="_blank">http://nginx.com/support.html</a></span></div>
</span></span>
</div>
<br></div></div></div></div></blockquote></div><br></div><div class="gmail_extra">Yes indeed, there is a rewrite !<br>got a tip on how to fix that ?</div>