upstream configuration item service_name, how to support dynamic fetching instead of fixed. For example, parsing from the tcp private protocol, or through http headers, or through http parameters
$ curl http://127.0.0.1:9180/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -i -d '
{
"uri": "/a/",
"plugins": {
"proxy-rewrite" : {
"regex_uri": ["^/a/(.)", "/${1}"]
}
},
"upstream": {
"service_name": "A-SERVICE",
"type": "roundrobin",
"discovery_type": "eureka"
}
}'
Description
upstream configuration item service_name, how to support dynamic fetching instead of fixed. For example, parsing from the tcp private protocol, or through http headers, or through http parameters $ curl http://127.0.0.1:9180/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -i -d ' { "uri": "/a/", "plugins": { "proxy-rewrite" : { "regex_uri": ["^/a/(.)", "/${1}"] } }, "upstream": { "service_name": "A-SERVICE", "type": "roundrobin", "discovery_type": "eureka" } }'
$ curl http://127.0.0.1:9180/apisix/admin/routes/2 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -i -d ' { "uri": "/b/", "plugins": { "proxy-rewrite" : { "regex_uri": ["^/b/(.)", "/${1}"] } }, "upstream": { "service_name": "B-SERVICE", "type": "roundrobin", "discovery_type": "eureka" } }'
Environment
apisix version
):360uname -a
):macosopenresty -V
ornginx -V
):curl http://127.0.0.1:9090/v1/server_info
):luarocks --version
):