`

openrest 操作 redis 相关

阅读更多

    

   

        OpenResty® 是一个基于 Nginx 与 Lua 的高性能 Web 平台,其内部集成了大量精良的 Lua 库、第三方模块以及大多数的依赖项。用于方便地搭建能够处理超高并发、扩展性极高的动态 Web 应用、Web 服务和动态网关。本质上就是一个Nginx+Lua的集成软件。

 

1、可以采用官网 http://openresty.org/en/download.html 下载安装新版本;

2、也可以命令工具安装

    

[root@docker ~]# yum install yum-utils
[root@docker ~]# yum-config-manager --add-repo https://openresty.org/package/centos/openresty.repo
[root@docker ~]# yum install openresty
[root@docker ~]# yum install openresty-resty

系统默认安装在/usr/local/openresty/目录下,版本如下

 

[root@docker openresty]# cd /usr/local/openresty/bin/
[root@docker bin]# ./openresty -v
nginx version: openresty/1.19.9.1

 

wget https://raw.githubusercontent.com/pintsized/lua-resty-http/master/lib/resty/http_headers.lua

wget https://raw.githubusercontent.com/pintsized/lua-resty-http/master/lib/resty/http.lua

放在/usr/local/openresty/lualib/resty目录下,对应用来http相关的组件;

下边就可以用lua来操作redis组件了,因为openresty已经包含了lua-resty-redis组件了;  可以参考文档:https://github.com/openresty/lua-resty-redis

 

3、脚本编写的时候

A、直接在nginx.conf  location 下添加:

 

https://www.cnblogs.com/xiao-xue-di/p/12972674.html

openresty 系列教程基本就是这个

 https://www.cnblogs.com/xiao-xue-di/category/1289827.html

https://www.it610.com/article/1298515155335847936.htm

 

 

 

 

 

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics