036_lua应用扩展

一、request_id定义

##
# request id
##
 
lua_package_path '/opt/nginx/conf/lua/lib/?.lua';
init_by_lua '
    uuid4 = require "uuid4"
';
 
access_by_lua '
    if ngx.var.http_x_eleme_requestid == nil then
        local id=uuid4.getUUID()
        ngx.req.set_header("X-Eleme-RequestID",id)
    end
';

二、

 

posted @ 2019-01-09 17:51  arun_yh  阅读(196)  评论(0编辑  收藏  举报