从nginx中的Set-Cookie标头登录值

时间:2013-08-09 00:39:51

标签: nginx setcookie access-log

是否可以在Cookie中为服务器响应(标题:Set-Cookie)写入密钥'uuid'的nginx访问日志值?

$ cookie_uuid - 返回发送客户端的uuid $ sent_http_set_cookie - 返回整个标题Set-Cookie:'uuid = 897587e7-a733-422f-9daa-b3105a5895aa;域= domain.com;路径= /; expires = Tue,09-Aug-2033 01:17:54 GMT',但我只需保存关键'uuid'的价值

由于

1 个答案:

答案 0 :(得分:3)

map $sent_http_set_cookie $resp_uuid {
    ~*uuid=(?<u>[0-9a-f-]+) $u;
}

参考: