Skip to content

Instantly share code, notes, and snippets.

@ezmobius
Created February 18, 2011 03:08
Show Gist options
  • Save ezmobius/833187 to your computer and use it in GitHub Desktop.
Save ezmobius/833187 to your computer and use it in GitHub Desktop.
# GET /recur?num=5
location /recur {
# MIME type determined by default_type:
default_type 'text/plain';
content_by_lua '
local num = tonumber(ngx.var.arg_num) or 0
ngx.say("num is: ", num)
if num > 0 then
res = ngx.location.capture("/recur?num=" .. tostring(num - 1))
ngx.print("status=", res.status, " ")
ngx.print("body=", res.body)
else
ngx.say("end")
end
';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment