|
|
local moduleName = ...
|
|
|
local M = {}
|
|
|
_G[moduleName] = M
|
|
|
|
|
|
local modname= ...
|
|
|
local M={}
|
|
|
_G[modname]=M
|
|
|
package.loaded[modname]=M
|
|
|
|
|
|
-- author: chunhua.zhang
|
|
|
-- only allow request from local ip and nat ip
|
...
|
...
|
@@ -25,7 +25,8 @@ local local_cidr = { |
|
|
|
|
|
-- check if ip is local
|
|
|
-- depends on $real_ip which setup by setup.lua
|
|
|
function M.check_local_access()
|
|
|
function M:check_local_access()
|
|
|
|
|
|
local ip=string.gsub(ngx.var.remote_addr,"%s","")
|
|
|
|
|
|
local is_local_ip = false
|
...
|
...
|
@@ -38,4 +39,6 @@ function M.check_local_access() |
|
|
end
|
|
|
|
|
|
return is_local_ip
|
|
|
end |
|
|
\ No newline at end of file |
|
|
end
|
|
|
|
|
|
|
...
|
...
|
|