Hello folks,<br><br>Just thought I would report a small bug with <font class="Apple-style-span" face="'courier new', monospace">rewrite</font> interacting with <font class="Apple-style-span" face="'courier new', monospace">if</font>.<br>
<br><div>Here is my simple setup:</div><div><blockquote><font class="Apple-style-span" face="'courier new', monospace">server {<br> server_name <a href="http://example.dev.com">example.dev.com</a>;<br> location ^~ /salad/add {<br>
if ($arg_paramThree = "foobar") {<br> rewrite ^ <a href="https://example.this.com?PARAM_ONE=$arg_paramOne&PARAM_TWO=$arg_paramTwo">https://example.this.com?PARAM_ONE=$arg_paramOne&PARAM_TWO=$arg_paramTwo</a>? redirect;<br>
}<br> proxy_pass http://127.0.0.1:8080$request_uri;<br> }<br>}</font></blockquote></div><div>So when I hit the server with this URL:</div><div><br></div><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;">
<div><font class="Apple-style-span" face="'courier new', monospace"><a href="http://example.dev.com/salad/add?paramThree=foobar¶mTwo=two¶mOne=one">http://example.dev.com/salad/add?paramThree=foobar¶mTwo=two¶mOne=one</a></font></div>
</blockquote><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-style-span" style="font-family: arial; "><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-style-span" style="font-family: arial; "><br>
</span></font></div>It is rewritten to be:</span></font><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-style-span" style="font-family: arial; "><br></span></font></div><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;">
<div><font class="Apple-style-span" face="'courier new', monospace"><a href="https://example.this.com?PARAM_ONE=one&PARAM_TWO=two?paramThree=foobar">https://example.this.com?PARAM_ONE=one&PARAM_TWO=two?paramThree=foobar</a></font></div>
</blockquote><font class="Apple-style-span" face="'courier new', monospace"><br></font><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-style-span" style="font-family: arial; ">If I use the following if conditional, the behavior is as expected:</span></font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-style-span" style="font-family: arial; "><br></span></font></div><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;">
<div><font class="Apple-style-span" face="'courier new', monospace">if ($args ~ "paramThree=foobar") {</font></div></blockquote><font class="Apple-style-span" face="'courier new', monospace"><br>
</font><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-style-span" style="font-family: arial; ">I tried to use OpenID for Nginx Trac, but am a little leary to do so because the server cert is not valid. So I am posting it here.</span></font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-style-span" style="font-family: arial; "><br></span></font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-style-span" style="font-family: arial; ">Thanks,</span></font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-style-span" style="font-family: arial; ">-peter</span></font></div>