window: Nginx+Lua+Redis 构建高并发应用
2016-08-09 00:00
375 查看
1.下载支持 Lua的Nginx---Openresty: https://openresty.org/download/openresty-1.9.15.1-win32.zip
2.nginx.conf设置Lua的文件目录
2.编写一个Redis脚本放到lua目录里:
3.运行Nginx
2.nginx.conf设置Lua的文件目录
location /lua { default_type text/plain; #lua_code_cache on; content_by_lua_file lua/demo.lua; }
2.编写一个Redis脚本放到lua目录里:
local redis = require "resty.redis" local client = redis.new() client.connect(client, '127.0.0.1', '6379')//IP和端口 client.auth(client,'auth')//设置Redis密码 client:select(0) local value = client:hget('List','abc') ngx.redirect(value) //实现跳转
3.运行Nginx
相关文章推荐
- nginx+lua+redis构建高并发应用
- 使用ngx_lua构建高并发应用(2)
- nginx+lua+redis构建高并发应用
- 【Nginx探究系列三】nginx+lua+redis构建高并发应用
- nginx+lua+redis构建高并发应用(转)
- 使用ngx_lua构建高并发应用(1)
- Nginx+Lua+Redis构建高并发应用
- 使用ngx_lua构建高并发应用
- nginx+lua+redis构建高并发应用(ubuntu)
- 使用ngx_lua构建高并发应用(2)
- 使用ngx_lua构建高并发应用(1)
- 构建高性能、高并发的JAVA应用系统
- 构建高性能、高并发的JAVA应用系统
- nginx+lua+redis构建高并发应用
- 使用ngx_lua构建高并发应用(1)
- 使用ngx_lua构建高并发应用(1)
- 使用ngx_lua构建高并发应用(1)
- 使用ngx_lua构建高并发应用
- nginx+lua+redis构建高并发应用
- 使用ngx_lua构建高并发应用