openresty资料之基本操作,openresty基本操作


◆ 在nginx.conf中配置lua脚本:
1、直接在nginx.conf中编写

location /hello {
    default_type text/html;
    content_by_lua 'ngx.say("<p>hello,world!</p>")';
}

2、在nginx.conf中引用lua脚本

location /hello {
    content_by_lua_file lua/hello.lua;
}

hello.lua脚本

ngx.say("hello,world!!!!!") 

相关内容

    暂无相关文章