https://github.com/bungle/lua-resty-templatehttps://github.com/bungle/lua-resty-template解压后:将 lib里面的文件(template.lua + template目录)复制到 openresty-1.21.4.1-win64\lualib\resty下
注:模板错误信息输出在 Nginx 日志中 log\error.log
Nginx 配置
http{
init_by_lua_block {
template = require 'resty.template'
}
server {
......
set $template_root ./site/demo/tpl;
location /tpl
{
default_type text/html;
content_by_lua "
local html = template.compile('view.html')({ message = 'Hello, World!