Hazel6869 commented on issue #8290: URL: https://github.com/apache/apisix/issues/8290#issuecomment-1309637959
> > @chyoong i give you an example > > `curl http://127.0.0.1:9180/apisix/admin/routes/1 \ -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d ' { "uri": "/index.html", "plugins": { "traffic-split": { "rules": [ { "match": [ { "vars": [ ["http_release","==","new_release"] ] } ], "weighted_upstreams": [ { "upstream": { "name": "upstream_A", "type": "roundrobin", "nodes": { "127.0.0.1:1981":10 } } } ] } ] } }, "upstream": { "type": "roundrobin", "nodes": { "127.0.0.1:1980": 1 } } }' ` > > @Hazel6869 Let me give you an example: > > ```json > { > "uri": "/*", > "name": "111", > "methods": [ > "GET" > ], > "host": "www.baidu.com", > "plugins": { > "traffic-split": { > "rules": [ > { > "match": [ > { > "vars": [ > [ > "cookie_env", > "==", > "a" > ] > ] > } > ], > "weighted_upstreams": [ > { ... } > ] > } > ] > } > }, > "service_id": "430541345438827213", > "status": 1 > } > ``` > > When cookie_env=a, point to baidu.com on the Internet. If cookie_env is not a, then point to service_id internally let me experiment it. 🤔 -- 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]
