一.安装配置Openresty 1,安装 wget https://openresty.org/download/ngx_openresty-1.9.7.1.tar.gz # 下载 tar xzvf ngx_openresty-1.9.7.1.tar.gz # 解压 cd ngx_openresty-1.9.7.1/ ./configure make make install 2,配置nginx.conf 按照上一步安装的默认路径为:/usr/local/openresty/nginx/conf
人狠话不多,直接上代码:------------------------------------------------------------------------------------- local headers=ngx.req.get_headers() local clientIP = headers["x-forwarded-for"] or clientIP == "unknown" then clientIP = headers["Pr
openresty(nginx+lua)中获取不到post数据,ngx.req.get_body_data返回nil This function returns nil if the request body has not been read, the request body has been read into disk temporary files, or the request body has zero size. 打开nginx调试日志 error_log /var/log/ng
Lua [1] 是一个小巧的脚本语言.它是巴西里约热内卢天主教大学(Pontifical Catholic University of Rio de Janeiro)里的一个由Roberto Ierusalimschy.Waldemar Celes 和 Luiz Henrique de Figueiredo三人所组成的研究小组于1993年开发的. 其设计目的是为了通过灵活嵌入应用程序中从而为应用程序提供灵活的扩展和定制功能.Lua由标准C编写而成,几乎在所有操作系统和平台上都可以编译,运行.L