首页 > 解决方案 > 如何从 NGINX 代理获取 TLS 会话 ID?

问题描述

在 Node.js 中,标头在 req.headers 中可用,我确实在 http 服务器中获取它们。我想获取由 Nginx 代理设置的 TLS 会话 ID,其中相关部​​分中的设置以及其他标头是:

location / {
...
proxy_set_header X-tlsSessionId $ssl_session_id;
...
 proxy_http_version 1.1;
 proxy_set_header Upgrade $http_upgrade;
 proxy_set_header Connection "upgrade";
 proxy_buffering off;
 expires off;

}

当我尝试将其作为 req.headers[x-tlssessionid] 访问时,我能够访问其他自定义标头但不能访问 X-tlsSessionId 我认为小写是我用来访问自定义标头的,但这个确实不行。

标签: node.jsnginxtls1.2

解决方案


推荐阅读