log a more meaningful message when backend is not found

This commit is contained in:
Elvin Efendi 2018-03-30 12:45:28 -04:00
parent 6fa7afe8bb
commit 3727cc2567
2 changed files with 9 additions and 3 deletions

File diff suppressed because one or more lines are too long

View file

@ -27,7 +27,13 @@ end
local function get_current_backend()
local backend_name = ngx.var.proxy_upstream_name
return backends:get(backend_name)
local backend = backends:get(backend_name)
if not backend then
ngx.log(ngx.WARN, "no backend configuration found for " .. tostring(backend_name))
end
return backend
end
local function get_current_lb_alg()