写一个小例子--输出随机字符串 编写nginx配置文件 location /random { content_by_lua_file /usr/local/openresty/nginx/conf/lua/random.lua; } 编写random.lua文件 local args = ngx.req.get_uri_args() local salt = args.salt if not salt then ngx.exit(ngx.HTTP_BAD_REQUEST) end local s
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