-
Notifications
You must be signed in to change notification settings - Fork 153
Open
Description
tried different variants of configuration, no change
config:
$upstream_name used in log_format
server {
..
set $upstream_name 'undef';
..
..
}
location @siteapi_common {
..
log_by_lua_block {
ngx.var.upstream_name = "test"
local upstream = require "ngx.upstream"
ngx.log(ngx.INFO, "upstream = " .. tostring(upstream.current_upstream_name()))
local upstream_name = upstream.current_upstream_name()
ngx.var.upstream_name = upstream_name
}
..
proxy_pass $backend_scheme://_bk_api_common;
}
expect to see upstream name (_bk_api_common) in logs but got 'test' string and following in error.log:
2016/12/29 16:13:16 [error] 12547#12547: *20 failed to run log_by_lua*: log_by_lua(api_fallback:36):4: no srv conf for upstream
stack traceback:
[C]: in function 'current_upstream_name'
log_by_lua(api_fallback:36):4: in function <log_by_lua(api_fallback:36):1> while logging request, client: ip, server:test, request: "GET /_api/deals/", host: "dev-10--www.testsite"
upstreams are working fine.
What can cause 'no srv conf for upstream' error?
Metadata
Metadata
Assignees
Labels
No labels