opm get SkyLothar/lua-resty-jwtopm get p0pr0ck5/lua-resty-cookieopm get agentzh/lua-resty-httpbungle/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;         }原文:http://www.cnblogs.com/rongfengliang/p/7045366.html