Nginx $request_uri有重复的查询参数
我发现nginx的$request_uri复制了查询参数.
我希望实现的目标是将裸域的任何请求重定向到www域.这是一个示例配置.
server {
listen 8080;
server_name localhost;
location / {
if ($http_host !~* "^www\.") {
rewrite (.*) http://www.$http_host$request_uri permanent;
}
}
}
我得到的结果是:
curl -I http://127.0.0.1:8080/pp/\?a\=b
HTTP/1.1 301 Moved Permanently
Server: nginx/1.6.2
Date: Thu, 22 Jan 2015 04:07:39 GMT
Content-Type: text/html
Content-Length: 184
Connection: keep-alive
Location: http://www.127.0.0.1:8080/pp/?a=b?a=b
查询参数在结果中重复;我在这里错过了什么吗?