Skip to content

Commit

Permalink
fix ip
Browse files Browse the repository at this point in the history
  • Loading branch information
loveshell committed Jan 10, 2016
1 parent fa5bf74 commit 3492d06
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3492d06

Please sign in to comment.