fix ctx usage in reverse proxy + remove useless log in limit
This commit is contained in:
parent
23f9f14a46
commit
a1385fe9b3
|
@ -62,7 +62,6 @@ function limit:init()
|
|||
if variables == nil then
|
||||
return self:ret(false, err)
|
||||
end
|
||||
self.logger:log(ngx.ERR, cjson.encode(variables))
|
||||
-- Store URLs and rates
|
||||
local data = {}
|
||||
local i = 0
|
||||
|
|
|
@ -21,7 +21,7 @@ function reverseproxy:header()
|
|||
end
|
||||
-- Add reverseproxy client headers
|
||||
for srv, vars in pairs(variables) do
|
||||
if srv == ngx.ctx.bw.server_name then
|
||||
if srv == self.ctx.bw.server_name then
|
||||
for var, value in pairs(vars) do
|
||||
if utils.regex_match(var, "REVERSE_PROXY_HEADERS_CLIENT") and value then
|
||||
local iterator, err = ngx.re.gmatch(value, "([\\w-]+) ([^;]+)")
|
||||
|
|
Loading…
Reference in New Issue