2019-06-17 23:17:41 +08:00
|
|
|
local _M = {}
|
|
|
|
|
|
|
|
|
|
|
|
function _M.hello()
|
|
|
|
ngx.say("hello world")
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function _M.server_port()
|
|
|
|
ngx.print(ngx.var.server_port)
|
|
|
|
end
|
|
|
|
|
|
|
|
|
2019-06-24 17:02:53 +08:00
|
|
|
function _M.limit_conn()
|
|
|
|
ngx.sleep(0.3)
|
|
|
|
ngx.say("hello world")
|
|
|
|
end
|
|
|
|
|
|
|
|
|
2019-07-17 23:52:15 +08:00
|
|
|
function _M.status()
|
|
|
|
ngx.say("ok")
|
|
|
|
end
|
|
|
|
|
2019-07-22 11:27:30 +08:00
|
|
|
function _M.sleep1()
|
|
|
|
ngx.sleep(1)
|
|
|
|
ngx.say("ok")
|
|
|
|
end
|
|
|
|
|
2019-07-17 23:52:15 +08:00
|
|
|
|
2019-06-17 23:17:41 +08:00
|
|
|
function _M.go()
|
|
|
|
local action = string.sub(ngx.var.uri, 2)
|
|
|
|
if not _M[action] then
|
|
|
|
return ngx.exit(404)
|
|
|
|
end
|
|
|
|
|
|
|
|
return _M[action]()
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
return _M
|