Fix bug when auth req is enabled(external authentication) (#2280)

* set proxy_upstream_name correctly when auth_req module is used

* log a more meaningful message when backend is not found
This commit is contained in:
Elvin Efendi 2018-03-30 13:19:33 -04:00 committed by Manuel Alejandro de Brito Fontes
parent bcb162ac0f
commit 931e541fb7
3 changed files with 14 additions and 4 deletions

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()