I don&#39;t know if this is related to the issues mentioned here, but when we have rewrite rule like<div><br></div><div>rewrite ^/arch/(.*) /cgi-bin/open_cache.pl?file=$1 last;<br><div><br></div><div>and url</div><div><br>
</div><div>/arch/person2.php%2525253F%25252526st%2525253D1013880915.1.html.html</div><div><br></div><div>then in nginx 0.5 this will be passed to the cgi as</div><div><br></div><div>GET /cgi-bin/open_cache.pl?file=person2.php%2525253F%25252526st%2525253D1013880915.1.html.html HTTP/1.0</div>
<div><br></div><div>But in nginx 0.6 (maybe even in higher versions) is this url passed as</div><div><br></div><div>GET /cgi-bin/open_cache.pl?basefile=person2.php%25253F%252526st%25253D1013880915.1.html.html HTTP/1.0</div>
<div><br></div><div>As you can see some of the chars where unescaped.</div><div><div><br><div class="gmail_quote">2008/6/24 Igor Sysoev <span dir="ltr">&lt;<a href="mailto:is@rambler-co.ru">is@rambler-co.ru</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div></div><div class="h5">On Tue, Jun 24, 2008 at 06:03:51PM +0200, Peter Hoang wrote:<br>
<br>
&gt; Furthermore, it seems like NGINX seems to decode the parameter in<br>
&gt; rewrite rules. For example, I have the following rule:<br>
&gt;<br>
&gt;       if ($args ~ ^q=([^&amp;]+)$) {<br>
&gt;         set $q $1;<br>
&gt;         rewrite ^/j /cms/q-$q.html? permanent;<br>
&gt;       }<br>
&gt;<br>
&gt; Now if I enter the <a href="http://localhost/j?q=c%2B%2B" target="_blank">http://localhost/j?q=c%2B%2B</a> then NGINX will redirect<br>
&gt; me to <a href="http://localhost/cms/q-c++.html" target="_blank">http://localhost/cms/q-c++.html</a> . I was expected that the final<br>
&gt; url would be <a href="http://localhost/cms/q-%2B%2B.html" target="_blank">http://localhost/cms/q-%2B%2B.html</a>. Is there a way to<br>
&gt; prevent this from happening? Thanks.<br>
<br>
</div></div>It had been implemented long ago in 0.3.10:<br>
<br>
    *) Bugfix: the &quot;rewrite&quot; directive did not unescape URI part in<br>
       redirect, now it is unescaped except the %00-%25 and %7F-%FF<br>
       characters.<br>
<br>
Why do you need &quot;c%2B%2B&quot; in URL ? &quot;c++&quot; is valid unambiguous URL part.<br>
<div><div></div><div class="h5"><br>
<br>
--<br>
Igor Sysoev<br>
<a href="http://sysoev.ru/en/" target="_blank">http://sysoev.ru/en/</a><br>
<br>
</div></div></blockquote></div><br></div></div></div>