Created
May 11, 2016 14:38
-
-
Save sagnitude/9b8e8f7ae09756acb521f2e5531935ee to your computer and use it in GitHub Desktop.
nginx_lua_test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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