nginx是個(gè)好東西, nginx的openrtsy發(fā)行版本更是個(gè)好東西。
今天又發(fā)現(xiàn)個(gè)好東西 :Moochine
--屬性
method = ngx.var.request_method -- http://wiki./HttpCoreModule#.24request_method
schema = ngx.var.schema -- http://wiki./HttpCoreModule#.24scheme
host = ngx.var.host -- http://wiki./HttpCoreModule#.24host
hostname = ngx.var.hostname -- http://wiki./HttpCoreModule#.24hostname
uri = ngx.var.request_uri -- http://wiki./HttpCoreModule#.24request_uri
path = ngx.var.uri -- http://wiki./HttpCoreModule#.24uri
filename = ngx.var.request_filename -- http://wiki./HttpCoreModule#.24request_filename
query_string = ngx.var.query_string -- http://wiki./HttpCoreModule#.24query_string
user_agent = ngx.var.http_user_agent -- http://wiki./HttpCoreModule#.24http_HEADER
remote_addr = ngx.var.remote_addr -- http://wiki./HttpCoreModule#.24remote_addr
remote_port = ngx.var.remote_port -- http://wiki./HttpCoreModule#.24remote_port
remote_user = ngx.var.remote_user -- http://wiki./HttpCoreModule#.24remote_user
remote_passwd = ngx.var.remote_passwd -- http://wiki./HttpCoreModule#.24remote_passwd
content_type = ngx.var.content_type -- http://wiki./HttpCoreModule#.24content_type
content_length = ngx.var.content_length -- http://wiki./HttpCoreModule#.24content_length
headers = ngx.req.get_headers() -- http://wiki./HttpLuaModule#ngx.req.get_headers
uri_args = ngx.req.get_uri_args() -- http://wiki./HttpLuaModule#ngx.req.get_uri_args
post_args = ngx.req.get_post_args() -- http://wiki./HttpLuaModule#ngx.req.get_post_args
socket = ngx.req.socket -- http://wiki./HttpLuaModule#ngx.req.socket
--方法
request:read_body() -- http://wiki./HttpLuaModule#ngx.req.read_body
request:get_uri_arg(name, default)
request:get_post_arg(name, default)
request:get_arg(name, default)
request:get_cookie(key, decrypt)
request:rewrite(uri, jump) -- http://wiki./HttpLuaModule#ngx.req.set_uri
request:set_uri_args(args) -- http://wiki./HttpLuaModule#ngx.req.set_uri_args
response對(duì)象的屬性和方法
--屬性
headers = ngx.header -- http://wiki./HttpLuaModule#ngx.header.HEADER
--方法
response:set_cookie(key, value, encrypt, duration, path)
response:write(content)
response:writeln(content)
response:ltp(template,data)
response:redirect(url, status) -- http://wiki./HttpLuaModule#ngx.redirect
response:finish() -- http://wiki./HttpLuaModule#ngx.eof
response:is_finished()
response:defer(func, ...) -- 在response返回后執(zhí)行
支持 Multi-App 與 Sub-App