fix ctx usage in reverse proxy + remove useless log in limit

This commit is contained in:
Théophile Diot 2023-06-09 13:37:10 -04:00
parent 23f9f14a46
commit a1385fe9b3
No known key found for this signature in database
GPG Key ID: E752C80DB72BB014
2 changed files with 1 additions and 2 deletions

View File

@ -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

View File

@ -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-]+) ([^;]+)")