标签:enum err sig rest foo code require key val
opm get SkyLothar/lua-resty-jwt
opm get p0pr0ck5/lua-resty-cookie
opm get agentzh/lua-resty-http
bungle/lua-resty-template
location / {
access_by_lua_block {
local ck = require("resty.cookie");
local cookie, err = ck:new();
local jwt = require "resty.jwt"
local jwt_token = jwt:sign(
"lua-resty-jwt",
{
header={typ="JWT", alg="HS256"},
payload={foo="bar"}
}
)
-- ngx.say(ngx.header)
ngx.header.token_name = "dalong demo app";
cookie:set({key= "dalongapp",value = jwt_token})
}
proxy_pass http://XXXXXXXX;
}
标签:enum err sig rest foo code require key val
原文地址:http://www.cnblogs.com/rongfengliang/p/7045366.html