随笔分类 - Lua
摘要:在处理json时,有一个字段是数字并且位数很长,结果被处理为科学计数法 ...,"tradeId":101200111072902276000243,... 经过json.decode之后取到的tradeId是1.012001110729e+23 尝试各种方法之后只能通过字符串替换解决,利用正则表达
阅读全文
摘要:nginx配置 lua_package_path "/usr/local/openresty/lualib/resty/smtp/?.lua;;"; lua_need_request_body on; location ^~ /alarm/mail { resolver 202.106.0.20 v
阅读全文
摘要:openresty(nginx+lua)发http请求 利用location+proxy_pass间接实现 location ^~ /test/http { internal; proxy_pass http://test.com/path; } lua代码 local res, err = ngx
阅读全文
摘要: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
阅读全文
摘要:使用docker部署 1 下载 # wget https://github.com/doujiang24/lua-resty-kafka/archive/v0.06.tar.gz# tar xvf v0.06.tar.gz 2 准备配置文件testkafka.conf # vi testkafka.
阅读全文