Node.js 如何从NGINX代理获取TLS会话Id?
在Node.js中,头在req.headers中可用,我确实在http服务器中获得它们。 我想获取Nginx代理设置的TLS会话id,其中相关部分中的设置以及其他头是:Node.js 如何从NGINX代理获取TLS会话Id?,node.js,nginx,tls1.2,Node.js,Nginx,Tls1.2,在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
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;
}
当我尝试以请求头[X-tlsSessionId]的形式访问其他自定义头时,我可以访问其他自定义头,但不能访问X-tlsSessionId
我认为我使用小写字母来访问自定义标题,但这一个不起作用。您可以尝试
console.log(req.headers)
查看发送到您的应用程序的所有标题server@slebetman很抱歉,刚才的评论。该标头不在req.headers中。我在服务器上做了console.log。不过我看到了其他标题。