<div dir="ltr"><span style="font-family:arial,sans-serif;font-size:13px">Hey All,</span><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">I am trying to redirect (301) all HTTP request to TLS (HTTPS) and I keep getting duplicate query strings added to the uri. e.g.:</div>
<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px"><div>curl -I "<a href="http://foo.bar.example.com/foobar.css?v=2" target="_blank">http://foo.bar.example.com/foobar.css?v=2</a>"</div>
<div>HTTP/1.1 301 Moved Permanently</div><div>[clipped]</div><div>Location: <a href="http://foo.bar.example.com/foobar.css?v=2?v=2" target="_blank">http://foo.bar.example.com/foobar.css?v=2?v=2</a></div><div><br></div><div>
Nginx config:</div><div><br></div><div><div>location / { <span style="white-space:pre-wrap">               </span></div><div>if ($scheme = http) {</div><div>rewrite ^ https://$http_host$request_uri permanent; <span style="white-space:pre-wrap">                </span></div>
<div>}</div></div><div><br></div><div>Any ideas?</div><div><br></div><div>Thanks in advance.</div><div><div dir="ltr"><span style="border-collapse:collapse"><br><div dir="ltr" style="font-family:arial;font-size:small"><span style="border-collapse:collapse"><div>
<span style="border-collapse:collapse">Reg</span>ards,</div><div><br></div><a href="http://www.twitter.com/jdorfman" target="_blank">Justin Dorfman</a></span></div></span></div></div></div>
</div>