包含标签 nginx 的文章

Openresty-日志记录接口示例

local function close_db(db) if not db then return end db:close() end local mysql = require("resty.mysql") local db, err = mysql:new() if not db then ngx.say("new mysql error : ", err) return end db:set_timeout(1000) local props = { host = "127.0.0.1", port = 3306, database = "logs", user = "root", password = "root" } local res, err, errno, sqlstate = db:connect(props) if not res then ngx.say("connect to……

阅读全文