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
- 消灭零回复
- 热议问题
-
bladex微服务版本和saber3怎整合websocket,有没有案例呀
1
-
nacos多个实例数会很卡,前端请求一直转圈圈什么原因呢
1
-
请问OTA升级功能有无计划推出的时间?
1
-
前端页面登录,却报用户或密码错误
1
-
bladex依赖拉不下来,版本 2.9.1.RELEASE
1
-
bladex-boot项目导入2.9.0包报错
2
-
Bladex 3.4.0如何接入登录
1
-
Bladex用户信息扩展
1
-
从bladex切换到boot版本 路由不知道为什么总是报错
1
-
登入提示 java.lang.ClassNotFoundException: org.springblade.system.entity.Tenant,代码都是最新的
1
官方新品
扫一扫访问 Blade技术社区 移动端