location / {
# if ($server_port = 9058 ) {
# proxy_pass http://127.0.0.1:9059;
# }
#lua文件形式返回数据
# content_by_lua_file /lua-5.4.2/ad_load.lua;
content_by_lua_block {
ngx.header.content_type="application/json;charset=utf8"
local cjson = require("cjson")
ngx.say("hello")
ngx.flush(true)
ngx.say("I love you")
ngx.exit(ngx.OK)
}
}
nginx使用lua
于 2024-01-17 11:47:01 首次发布