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/([^?]*)") {

相关文章:

  • 2022-02-21
  • 2022-12-23
  • 2022-12-23
  • 2022-02-06
  • 2021-05-30
  • 2022-12-23
  • 2021-08-21
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-09-21
  • 2021-10-02
  • 2022-03-10
  • 2021-08-05
  • 2022-12-23
  • 2021-07-07
相关资源
相似解决方案