1.要先安装OpenResty的环境,安装地址 http://openresty.org/cn/installation.html
2.配置nginx.conf
location ^~ /business/ {
default_type application/json;
rewrite_by_lua_file /zzserver/acm/nginx/lua-code/error-service.lua;
access_by_lua_file /zzserver/acm/nginx/lua-code/tr-jwt-auth.lua;
proxy_pass http://localhost:8316/business/;
body_filter_by_lua_file /zzserver/acm/nginx/lua-code/post-handle-body.lua;
}
post-handle-body.lua的内容
local userAccount = ngx.header["User-Account"]
if userAccount == nil then userAccount = '' end if ngx.status == 500 then ngx.log(ngx.ERR, "failed request on current user:" .. userAccount) elseif ngx.status == 409 then local resp_body = string.sub(ngx.arg[1], 1, 1000) ngx.log(ngx.ERR, "conflict request on current user:" .. userAccount .. "======response body:" .. resp_body) end
tr-jwt-auth.lua的内容
local userAccount = ngx.header["User-Account"]
if userAccount == nil then userAccount = '' end if ngx.status == 500 then ngx.log(ngx.ERR, "failed request on current user:" .. userAccount) elseif ngx.status == 409 then local resp_body = string.sub(ngx.arg[1], 1, 1000) ngx.log(ngx.ERR, "conflict request on current user:" .. userAccount .. "======response body:" .. resp_body) end
- 消灭零回复
- 热议问题
-
物联网首页数据异常,首页显示的设备数与实际设备数严重不符
1
-
如何单独配置某个服务的skip-url
1
-
前端页面中,如果切换上面的标题选项不想要重新加载页面
1
-
流程管理 审核配置 选择指定审核人问题
1
-
强制有些sql查主库
1
-
报文加密后端加密后传给前端,前端解密发现long类型的数据精度丢失
1
-
iot后台通过feign调用不到服务
1
-
variables.scss的@use引入冲突
1
-
cloud版本远程调用提示file文件名不存在
1
-
BladeX-biz 新建module后,启动报错:Failed to determine suitable jdbc url
1
官方新品
扫一扫访问 Blade技术社区 移动端