nginx+lua (一)
2017-10-05 16:53
155 查看
项目工程结构
hello
hello.conf
lua
hello.lua
lualib
*.lua
*.so
新建hello.conf
server {
listen 80;
server_name _;
location /lua {
default_type 'text/html';
lua_code_cache off;
content_by_lua_file /usr/example/lua/test.lua;
}
}
新建 test.lua脚本
ngx.say("hello world"); (测试脚本)
增加配置
/usr/servers/nginx/conf/nginx.conf
在http中 include /usr/hello/hello.conf;
查看异常日志
tail -f /usr/servers/nginx/logs/error.log
重新nginx加载配置
/usr/servers/nginx/sbin/nginx -s reload
hello
hello.conf
lua
hello.lua
lualib
*.lua
*.so
新建hello.conf
server {
listen 80;
server_name _;
location /lua {
default_type 'text/html';
lua_code_cache off;
content_by_lua_file /usr/example/lua/test.lua;
}
}
新建 test.lua脚本
ngx.say("hello world"); (测试脚本)
增加配置
/usr/servers/nginx/conf/nginx.conf
在http中 include /usr/hello/hello.conf;
查看异常日志
tail -f /usr/servers/nginx/logs/error.log
重新nginx加载配置
/usr/servers/nginx/sbin/nginx -s reload
相关文章推荐
- 使用Nginx+Lua进行断点上传的demo
- Nginx+Lua开发
- nginx+lua_nginx+GraphicsMagick生成实时缩略图
- 跟我学OpenResty(Nginx+Lua)开发目录贴
- 基于nginx+lua简单的灰度发布系统
- nginx+lua的函数
- 第一章 安装OpenResty(Nginx+Lua)开发环境
- 使用Nginx+Lua(OpenResty)开发高性能Web应用
- 使用Nginx+Lua(OpenResty)开发高性能Web应用
- nginx+lua环境搭建笔记
- nginx+lua (二)请求分发
- Nginx+Lua(OpenResty)开发高性能Web应用
- 使用Nginx+Lua(OpenResty)开发高性能Web应用
- nginx+lua搭建文件上传下载服务
- Nginx+Lua服务端合并静态文件
- 使用Nginx+Lua进行Web开发
- 用Nginx+Lua(OpenResty)开发高性能Web应用
- nginx+lua图片服务器
- 使用Nginx+Lua(OpenResty)开发高性能Web应用