当我访问http://localhost/bill/detail/123?a=1&b=2
我希望它重定向到https://www.baidu.com/bill/detail/?a=1&b=2&term=123
下面是我的配置:
location /bill/detail {
rewrite ^/bill/detail/([\d]+)\?(.*)$ https://www.baidu.com?$2&term=$1 redirect;
}
但显示不匹配
2023/06/03 20:20:38 [notice] 3128#0: *5 "^/bill/detail/([\d]+)\?(.*)$" does not match "/bill/detail/1234", client: 127.0.0.1, server: 127.0.0.1, request: "GET /bill/detail/1234?a=1&b=2 HTTP/1.1", host: "localhost:5000"
1条答案
按热度按时间wn9m85ua1#
对于您的请求,请尝试以下操作: