spacewander commented on code in PR #7323:
URL: https://github.com/apache/apisix/pull/7323#discussion_r906919254
##########
apisix/conf_server.lua:
##########
@@ -136,13 +138,25 @@ local function pick_node(ctx)
ctx.server_picker = server_picker
ctx.balancer_server = server
- res = create_resolved_result(server)
+
+ for _, r in ipairs(resolved_results) do
+ if r.server == server then
+ res = r
+ break
+ end
+ end
else
res = resolved_results[1]
end
ctx.balancer_ip = res.host
ctx.balancer_port = res.port
+
+ ngx_var.upstream_host = res.domain or res.host
+ if balancer.recreate_request and ngx.get_phase() == "balancer" then
+ balancer.recreate_request()
+ end
Review Comment:
So we can use a new Host, see
https://github.com/openresty/lua-resty-core/blob/master/lib/ngx/balancer.md#recreate_request
--
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]