server {
if ($host ~* ^example.com) {
rewrite ^(.*) http://www.example.com$1 permanent;
}
}
当我发送 http://example.com/aa.jsp?time=1
这样的请求的时候。转发的请求变成了 http://www.example.com/aa.jsp
问号之后的参数都被丢弃了???
请问如何设置能部丢弃问号之后的参数? 谢谢谢谢
if ($host = 'example.com' ) {
rewrite ^/(.*)$ http://www.example.com/$1 permanent;
}
后来发现其实是自己在测试的时候犯错了。。。完善测试条件之后就一切正常了。谢谢你的回复