lua resty template && openresty 使用
luarocks install lua-resty-template
location /{root html;content_by_lua 'local template = require "resty.template"template.render("view.html",{ message ="Hello, World!"})';}
<!DOCTYPE html><html><body><h1>{{message}}</h1></body></html>
http {server {set $template_root /usr/local/openresty/nginx/html/templates;location /{root html;content_by_lua 'local template = require "resty.template"template.render("view.html",{ message ="Hello, World!"})';}}}
http {server {set $template_location /templates;location /{root html;content_by_lua 'local template = require "resty.template"template.render("view.html",{ message ="Hello, World!"})';}location /templates {internal;alias html/templates/;}}
https://github.com/bungle/lua-resty-template
lua resty template && openresty 使用的更多相关文章
- LUA+resty 搭建验证码服务器
使用Lua和OpenResty搭建验证码服务器 雨客 2016-04-08 16:38:11 浏览2525 评论0 云数据库Redis版 摘要: Lua下有个Lua-GD图形库,通过简单的Lua语句就 ...
- openresty + lua 1、openresty 连接 mysql,实现 crud
最近开发一个项目,公司使用的是 openresty + lua,所以就研究了 openresty + lua.介绍的话,我就不多说了,网上太多了. 写这个博客主要是记录一下,在学习的过程中遇到的一些坑 ...
- openresty + lua 4、openresty kafka
kafka 官网: https://kafka.apache.org/quickstart zookeeper 官网:https://zookeeper.apache.org/ kafka 运行需要 ...
- openresty + lua 2、openresty 连接 redis,实现 crud
redis 的话,openresty 已经集成,ng 的话,自己引入即可. github 地址:https://github.com/openresty/lua-resty-redis github ...
- openresty + lua 3、openresty http 调用
http 的话,openresty 已经集成,ng 的话,自己引入即可. github 地址:https://github.com/pintsized/lua-resty-http github 里提 ...
- 用Nginx+Lua(OpenResty)开发高性能Web应用
在互联网公司,Nginx可以说是标配组件,但是主要场景还是负载均衡.反向代理.代理缓存.限流等场景:而把Nginx作为一个Web容器使用的还不是那么广泛.Nginx的高性能是大家公认的,而Nginx开 ...
- Nginx+Lua(OpenResty)开发高性能Web应用
使用Nginx+Lua(OpenResty)开发高性能Web应用 博客分类: 跟我学Nginx+Lua开发 架构 ngx_luaopenresty 在互联网公司,Nginx可以说是标配组件,但是主要场 ...
- 使用Nginx+Lua(OpenResty)开发高性能Web应用
摘自(http://jinnianshilongnian.iteye.com/blog/2280928) 在互联网公司,Nginx可以说是标配组件,但是主要场景还是负载均衡.反向代理.代理缓存.限流等 ...
- openresty router && template 试用
router 是一个比较方便的 openresty 路由组件,我们可以用来编写灵活强大的 web 应用,类似的 lua-resty-route 也是很不错的,但是如果是比较简单的直接可以使用 lu ...
随机推荐
- 设计模式--状态模式C++实现
1定义 当一个状态的内在状态改变时允许其行为改变,这个对象看起来像改变了其类 2类图 角色分析 State抽象状态角色,接口或者抽象类,负责状态定义,并且封装环境角色以实现状态切换 ConcreteS ...
- Linux命令详解-hwclock/chock
hwclock命令可以用来显示/设置硬件时钟命令. 在Linux中有硬件时钟与系统时钟等两种时钟.硬件时钟是指主机板上的时钟设备,也就是通常可在BIOS画面设定的时钟.系统时钟则是指kernel中 的 ...
- ffmpeg播放RTSP的一点优化
简单记录一下最近使用ffmpeg播放RTSP做的一点参数优化. 先做如下定义: AVDictionary* options = NULL; 1.画质优化 原生的ffmpeg参数在对1920x1080的 ...
- hdu 6038 Function
Function Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total ...
- dubbo 之filter使用
1.继承接口com.alibaba.dubbo.rpc.Filter实现public Result invoke(Invoker<?> invoker, Invocation invoca ...
- jquery 判断checkbox状态
jquery判断checked的三种方法:.attr('checked): //看版本1.6+返回:”checked”或”undefined” ;1.5-返回:true或false.prop('c ...
- jquery.treetable.js
html: <table class="table table-hover table-responsive main-list" id="columntabl ...
- vue-one_demo_music
简单的音乐盒子 利用计算属性(监听数据),解决上一首,下一首,点击切换 <!DOCTYPE html> <html lang="en"> <head& ...
- mysql查询慢之后
|--缘起:早上刚一到公司就反映公司网站爆卡,线上erp完全无法使用,赶紧扔掉手中包子. --------------------------------------- |--排查:开发中会经常发现开 ...
- JAXP使用Stax API时格式化输出XML 2
之前实现的一个版本:http://www.cnblogs.com/lyhtbc/p/jaxp-pretty-format-validate-validation-stax-stax2.html 这个版 ...