shreemaan-abhishek commented on code in PR #13568:
URL: https://github.com/apache/apisix/pull/13568#discussion_r3432965359
##########
apisix/core/ctx.lua:
##########
@@ -244,6 +244,8 @@ do
route_name = true,
service_id = true,
service_name = true,
+ -- the upstream host before DNS resolution (configured domain/host)
+ upstream_unresolved_host = true,
Review Comment:
Good idea, done in the latest commit (db37b1f82).
Declared `set $upstream_unresolved_host '';` in `ngx_tpl.lua` and routed the
balancer writes through `ctx.var` (added it to `ngx_var_names`, removed it from
`apisix_var_names`), mirroring how `$llm_content_risk_level` is wired. So it is
now a real nginx variable usable directly in the access log format, in addition
to the APISIX logger plugins.
Added a `t/core/ctx.t` case that proxies to a domain upstream and asserts
the pre-DNS host shows up in the nginx access log.
--
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]