<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Hi all,<div>i'm seeing a strange behaviour in nginx rewrite involving encoded urls for <b>%27</b></div><div>I have this type of rewrite:</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">rewrite "^/brands/l-oreal$" <a href="https://somedomain.tld/L%27Or%C3%A9al-Paris/index.html">https://somedomain.tld/L%27Or%C3%A9al-Paris/index.html</a>? permanent;<br></blockquote><div><br></div><div>That translates to this:</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br> [~]> curl -kIL <a href="https://mydomain.tld/brands/l-oreal">https://mydomain.tld/brands/l-oreal</a><br>HTTP/2 301 <br>server: nginx<br>date: Wed, 14 Nov 2018 14:44:21 GMT<br>content-type: text/html<br>content-length: 178<br><b>location: <a href="https://somedomain.tld/L'Or%C3%A9al-Paris/index.html">https://somedomain.tld/L'Or%C3%A9al-Paris/index.html</a></b><br>strict-transport-security: max-age=15768000; includeSubDomains</blockquote><div><br></div><div> If i change %27 to %20 i have:</div><div><br></div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">[~]> curl -kIL <a href="https://mydomain.tld/brands/l-oreal">https://mydomain.tld/brands/l-oreal</a><br>HTTP/2 301 <br>server: nginx<br>date: Wed, 14 Nov 2018 14:31:09 GMT<br>content-type: text/html<br>content-length: 178<br><b>location: <a href="https://somedomain.tld/L%20Or%C3%A9al-Paris/index.html">https://somedomain.tld/L%20Or%C3%A9al-Paris/index.html</a></b><br>strict-transport-security: max-age=15768000; includeSubDomains</blockquote></div><div><br></div><div>as expected.</div><div><br></div><div>The same strange behaviour applies to <b>%2C</b>, that is decoded to "<b>,</b>" instead of being passed unencoded, as expected.</div><div>This is driving me nuts, can anyone explain (or fix) this? </div><div><br></div><div>Thanks!</div><div><br></div><div><br></div><div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr">"Madness, like small fish, runs in hosts, in vast numbers of instances."<div><br></div><div><div>Nessuno mi pettina bene come il vento.</div></div></div></div></div></div></div></div></div></div>