mirror of
https://gitee.com/iresty/apisix.git
synced 2024-12-14 08:51:29 +08:00
526e0cb70c
* feature(balancer): supported to set retries and timeouts, and set upstream node status by passive health check.
41 lines
487 B
Lua
41 lines
487 B
Lua
local _M = {}
|
|
|
|
|
|
function _M.hello()
|
|
ngx.say("hello world")
|
|
end
|
|
|
|
|
|
function _M.server_port()
|
|
ngx.print(ngx.var.server_port)
|
|
end
|
|
|
|
|
|
function _M.limit_conn()
|
|
ngx.sleep(0.3)
|
|
ngx.say("hello world")
|
|
end
|
|
|
|
|
|
function _M.status()
|
|
ngx.say("ok")
|
|
end
|
|
|
|
function _M.sleep1()
|
|
ngx.sleep(1)
|
|
ngx.say("ok")
|
|
end
|
|
|
|
|
|
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
|