location ~ / {
proxy_read_timeout 600s;
proxy_next_upstream_tries 1;
client_max_body_size 100m;
if ($request_uri ~ "/abcd/([^?]*)") {
set $path $1;
rewrite . /$path;
proxy_pass http://127.0.0.1:8081;
break;
}
proxy_pass http://127.0.0.1:8080;
}
從配置上看,rewrite后好像接收不到請求參數似的。其實是可以的。
另外下面兩行是不一樣的:
if ($request_uri ~ "/abcd/([^?]*)") {
if ($request ~ "/abcd/([^?]*)") {