环境安装参考:https://blog.csdn.net/oqzuser12345678999q/article/details/110466653
新建lua文件:test.lua
ngx.say("insert error : sqlstate : ")
配置nginx xxx.conf
server {
listen 9093;
server_name 192.168.0.128;
location /lua {
#set $test "hello,world";
#content_by_lua '
# ngx.header.content_type="text/plain"
#ngx.say(ngx.var.test)';
default_type 'text/html';
lua_code_cache on;
content_by_lua_file /etc/nginx/conf.d/test.lua;
}
}
然后运行:http://192.168.0.128:9093/lua
1万+

被折叠的 条评论
为什么被折叠?



