Lua - Nginx 结合的学习笔记.docVIP

  • 219
  • 0
  • 约5.79千字
  • 约 5页
  • 2016-12-21 发布于重庆
  • 举报
Lua - Nginx 结合的学习笔记 default_type : text/plain 表示传输的文本格式 content_by_lua : 指定lua 来处理字符。也可以是一段lua代码,可以执行. ngx 对象: ngx.print(...) 打印 ngx.var[arg_a] 或者 ngx.var.arg_a 来访问. 访问方式:/nginx_var?a=hello,world content_by_lua ngx.print(ngx.var[arg_a])” ngx.location.capture(‘/domain’); 访问内部的域名 返回对象包含:status , body 和 header对象 状态和内容. 例如:res = ngx.location.capture(‘/domain’); res.status 和 res.body lua_package_path 和 lua_package_cpath 指定查找lua文件时的路径. echo_location发送子请求到指定的location 例如:echo_location /bar; /bar 为一个location. Init_by_lua :初始化载入模块. 类似类的包机制. init_by_lua cjson = require cjson;

文档评论(0)

1亿VIP精品文档

相关文档