Query strings duplicating on 301 redirect

Justin Dorfman jdorfman at netdna.com
Mon May 5 19:14:48 UTC 2014


Hey All,

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.:

curl -I "http://foo.bar.example.com/foobar.css?v=2"
HTTP/1.1 301 Moved Permanently
[clipped]
Location: http://foo.bar.example.com/foobar.css?v=2?v=2

Nginx config:

location / {
if ($scheme = http) {
rewrite ^ https://$http_host$request_uri permanent;
}

Any ideas?

Thanks in advance.

Regards,

Justin Dorfman <http://www.twitter.com/jdorfman>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20140505/4278b7d0/attachment.html>


More information about the nginx mailing list