<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On Nov 13, 2012, at 12:41 , Nilshar wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">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-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; position: static; z-index: auto; ">
<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></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></blockquote></div><div><br></div>The general rule is to not use rewrites at all: they make configuration to a mess.<br><div><br><div>
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Georgia; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Georgia; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Georgia; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><br class="Apple-interchange-newline">--<br>Igor Sysoev<br></span></div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Georgia; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><a href="http://nginx.com/support.html">http://nginx.com/support.html</a></span></div></span></span>
</div>
<br></div></body></html>