githubxubin opened a new issue, #10052:
URL: https://github.com/apache/apisix/issues/10052

   ### Description
   
   When I used the traffic-split plugin, my matching criteria didn't work
   my step:
   step 1:
   set the route :
    my route config is :
   ```
   {
       "id": "474448073225929411",
       "create_time": 1692322688,
       "update_time": 1692324034,
       "uris": [
           "/http/*",
           "/fuwu/*"
       ],
       "name": "测试https12",
       "priority": 1,
       "methods": [
           "GET",
           "POST",
           "PUT",
           "DELETE",
           "PATCH",
           "HEAD",
           "OPTIONS"
       ],
       "hosts": [
           "cestest.com.cn",
           "yangcong.com.cn"
       ],
       "plugins": {
           "proxy-rewrite": {
               "headers": {
                   "ceshi": "aaa",
                   "ceshi1": "bbb",
                   "ceshi3": "ccc"
               },
               "method": "GET",
               "scheme": "http"
           },
           "traffic-split": {
               "disable": false,
               "rules": [
                   {
                       "match": [
                           {
                               "vars": [
                                   [
                                       "request_uri",
                                       "has",
                                       "/fuwu/1k.txt"
                                   ]
                               ]
                           }
                       ],
                       "weighted_upstreams": [
                           {
                               "upstream_id": "474448922102727363",
                               "weight": 1
                           },
                           {
                               "upstream_id": "474448948208075459",
                               "weight": 1
                           },
                           {
                               "weight": 1
                           }
                       ]
                   }
               ]
           }
       },
       "upstream": {
           "nodes": [
               {
                   "host": "10.4.16.14",
                   "port": 9080,
                   "weight": 1
               }
           ],
           "retries": 3,
           "timeout": {
               "connect": 30,
               "send": 30,
               "read": 60
           },
           "type": "roundrobin",
           "scheme": "http",
           "pass_host": "pass",
           "keepalive_pool": {
               "idle_timeout": 60,
               "requests": 1000,
               "size": 320
           },
           "retry_timeout": 5000
       },
       "status": 1
   }
   ```
   step 2 :
   access the apisix route:
    curl http://yangcong.com.cn:9080/fuwu/1k.txt 
   always  to  host:10.4.16.14
   
   However, my traffic does not match the upstream information in traffic-split 
and is forwarded to the route itself. Is there a problem with my expression
   ```
   ...
   "match": [
                           {
                               "vars": [
                                   [
                                       "request_uri",
                                       "has",
                                       "/fuwu/1k.txt"
                                   ]
                               ]
                           }
                       ],
   ...
   ```
   
   
   ### Environment
   
   - APISIX version (run `apisix version`):2.15
   - Operating system (run `uname -a`):
   - OpenResty / Nginx version (run `openresty -V` or `nginx -V`):
   - etcd version, if relevant (run `curl 
http://127.0.0.1:9090/v1/server_info`):
   - APISIX Dashboard version, if relevant:
   - Plugin runner version, for issues related to plugin runners:
   - LuaRocks version, for installation issues (run `luarocks --version`):
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to