从Nginx中的Set

编程入门 行业动态 更新时间:2024-10-26 18:23:41
本文介绍了从Nginx中的Set-Cookie标头登录值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

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

Is it possible to write in nginx access log value of key 'uuid' from Cookie for server response (header: Set-Cookie)?

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

$cookie_uuid - return uuid that sent client $sent_http_set_cookie - return whole header Set-Cookie: 'uuid=897587e7-a733-422f-9daa-b3105a5895aa; domain=domain; path=/; expires=Tue, 09-Aug-2033 01:17:54 GMT', but I need save only value for key 'uuid'

谢谢

推荐答案

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

参考:

  • nginx/r/map
  • 人pcresyntax

更多推荐

从Nginx中的Set

本文发布于:2023-10-29 10:35:57,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1539461.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Nginx   Set

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!