chilcano commented on issue #10796: URL: https://github.com/apache/apisix/issues/10796#issuecomment-1886784188
Just updated my Upstream and Route, now I'm using some free echo services to make easier to debug it. Unfortunately, after some attempts, this has not get working. 1. I have not been able to overwritten the HTTP Header `host`, but I've been able to write `x_my_host`. 2. The Upstream doesn't select the node based on the `key`. As I stated before, I've added a custom HTTP Header called `x_my_host` but this is not used as key to choose the right node. 3. The Upstream randomly choose the all available nodes. Below my code if you need explore and reproduce this scenario: ```sh curl http://127.0.0.1:9180/apisix/admin/upstreams/1101 -H "X-API-KEY: $APISIX_KEY" -X PUT -d ' { "name": "App upstream", "type": "chash", "hash_on": "header", "key": "x_my_host", "scheme": "https", "pass_host": "node", "nodes": { "echo.zuplo.io": 10, "echo-api.3scale.net": 10, "echo.free.beeceptor.com": 10 } }' Thanks. curl http://127.0.0.1:9180/apisix/admin/routes/1101 -H "X-API-KEY: $APISIX_KEY" -X PUT -d ' { "name": "App route", "methods": ["GET", "POST"], "uri": "/rpc/*", "plugins": { "proxy-rewrite": { "regex_uri": ["^/rpc/(.*)/(.*)", "/v3/$2"], "headers": { "set": { "host": "$1", "x_my_host": "$1", "x_my_req_uri": "$request_uri" } } } }, "upstream_id": 1101 }' -- 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]
