From 3492d0601ced262990b1802b824c17fa0c75828e Mon Sep 17 00:00:00 2001 From: loveshell <82163261@qq.com> Date: Sun, 10 Jan 2016 22:45:34 +0800 Subject: [PATCH] fix ip --- init.lua | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/init.lua b/init.lua index eb44bf0..3eaf381 100644 --- a/init.lua +++ b/init.lua @@ -15,10 +15,7 @@ attacklog = optionIsOn(attacklog) CCDeny = optionIsOn(CCDeny) Redirect=optionIsOn(Redirect) function getClientIp() - IP = ngx.req.get_headers()["X-Real-IP"] - if IP == nil then - IP = ngx.var.remote_addr - end + IP = ngx.var.remote_addr if IP == nil then IP = "unknown" end