随笔分类 -  Lua

摘要:在处理json时,有一个字段是数字并且位数很长,结果被处理为科学计数法 ...,"tradeId":101200111072902276000243,... 经过json.decode之后取到的tradeId是1.012001110729e+23 尝试各种方法之后只能通过字符串替换解决,利用正则表达 阅读全文
posted @ 2020-01-15 21:37 匠人先生 阅读(1964) 评论(1) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2019-08-05 20:47 匠人先生 阅读(885) 评论(0) 推荐(0) 编辑
摘要:openresty(nginx+lua)发http请求 利用location+proxy_pass间接实现 location ^~ /test/http { internal; proxy_pass http://test.com/path; } lua代码 local res, err = ngx 阅读全文
posted @ 2019-07-29 20:36 匠人先生 阅读(1411) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2019-07-27 00:26 匠人先生 阅读(3404) 评论(1) 推荐(0) 编辑
摘要:使用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. 阅读全文
posted @ 2019-03-08 22:29 匠人先生 阅读(2073) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示