Closed hulu1522 closed 7 years ago
@mikaeljorhult
-- =============================================================
-- TODO: Remove after other apps handle unique login requests =
-- =============================================================
local addr = ngx.header["CF-Connecting-IP"] or
ngx.header["Fastly-Client-IP"] or
ngx.header["Incap-Client-IP"] or
ngx.header["X-Real-IP"]
-- NOTE: This is only used as a last resort for IP
if not addr then
addr = ngx.header["X-Forwarded-For"]
if addr then
local s = (addr:find(',', 1, true))
if s then
addr = addr:sub(1, s - 1)
end
else
addr = ngx.var.remote_addr
end
end
Great! Thank you, again!
Looks good. To you have an example file (in Lua) for me to test?