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-boot 客户端更新后,怎么让所有用户token失效重新登录;
1
-
nacos 配置文件覆盖不了blade-dev.yaml
1
-
怎么开启用户注册功能
1
-
中央仓库未找到授权TOOL版本 jar包
1
-
代码生成报错Could not initialize class org.apache.velocity.util.introspection.MethodMap
1
-
bladex4.3.0 想要修改切换角色和部门这个功能
1
-
代码生成使用sqlserver数据源错误
1
-
发布物模型提示数据库错误
1
-
Bladex-boot 4.4版本 多数据源和 flowable 冲突 如何解决
1
-
proguard混淆后出错
1
官方新品
扫一扫访问 Blade技术社区 移动端