
openresty
wangc_gogo
一个标点符号一篇博客,也是一种进步!!!
展开
-
lua 之http请求内部请求
# 1、内部请求单个(只能请求内部服务)```ngx.location.capture(uri,{options...});local res = ngx.location.capture("order",{ method = ngx.HTTP_GET, #设置请求方式为get请求 args = {orderId=1,userId=2}, # get请求参数 body = "orderId=1&userId=2" ...原创 2020-09-16 09:57:31 · 978 阅读 · 0 评论 -
ngnix location 详解 last和break
root html;html/test/50.htmllast会重新发起请求,而break会直接查找资源具体见演示: location /break/ { rewrite ^/break/(.*) /test/$1 break; } location /last/ { rew...原创 2019-12-02 13:20:59 · 411 阅读 · 0 评论 -
lua openresty 阶段详解图
原创 2019-12-02 08:11:51 · 558 阅读 · 0 评论 -
nginx 执行的11个阶段
nginx代码执行的的顺序与执行阶段有关,与代码的实际顺序无关(在有阶段区分时)原创 2019-12-02 08:05:17 · 496 阅读 · 0 评论 -
nginx lua http 请求转发
转发:get请求 location /product { internal; echo "商品信息"; } location /order { content_by_lua_block{ local resp = ngx.locat...原创 2019-12-01 18:31:32 · 865 阅读 · 0 评论 -
lua redis 管道
local redis = require "resty.redis_iresty"local opts = { ip = "192.168.31.247", port = "6379", password = "123456", db_index = 1}local red = redis:new(opts)local red =redis:new(o...原创 2019-12-01 08:15:11 · 310 阅读 · 0 评论 -
redis lua 二次封装类库
local redis_c = require "resty.redis"local ok, new_tab = pcall(require, "table.new")if not ok or type(new_tab) ~= "function" then new_tab = function (narr, nrec) return {} endendlocal _M = n...原创 2019-12-01 08:10:13 · 471 阅读 · 0 评论 -
lua + redis 连接池设置
local function close_redis(red) if not red then return end local pool_max_idle_time =10000 local pool_size =100 local ok,err = red:set_keepalive(pool_max_idle_time,...原创 2019-12-01 07:37:20 · 2681 阅读 · 0 评论 -
opresty + lua +redis helloworld
--关闭连接local function close_redis(red) if not red then return end local ok,err =red:close() if not ok then ngx.say("close redis err :",err) endend-...原创 2019-12-01 07:02:32 · 204 阅读 · 0 评论 -
openresty 安装、主要模块解释
make && make install默认安装在usr/local/openresty原创 2019-11-25 10:58:16 · 907 阅读 · 0 评论 -
openresty 入门(安装)
参考:https://www.cnblogs.com/zdz8207/p/Nginx-Lua-OpenResty.htmlOpenResty的安装:(1) 需要事先安装一下所需的插件yuminstallreadline-develpcre-developenssl-devel(2) 下载ngx_openresty-1.7.7.2.tar.gz并解压wgethttp:...原创 2019-05-04 15:02:06 · 241 阅读 · 0 评论