Skip to content

Instantly share code, notes, and snippets.

@sagnitude
Created May 11, 2016 14:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sagnitude/9b8e8f7ae09756acb521f2e5531935ee to your computer and use it in GitHub Desktop.
Save sagnitude/9b8e8f7ae09756acb521f2e5531935ee to your computer and use it in GitHub Desktop.
nginx_lua_test
location /test {
content_by_lua_block {
local arg = ngx.var.arg_upload
local method = ngx.req.get_method()
if method == "POST" then
if arg then
ngx.exec("@flash")
else
ngx.exec("@post")
end
end
if method == "GET" then
ngx.say("get")
end
}
}
location @post {
return 404;
}
location @flash {
return 403;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment