Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/42.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js 如何从NGINX代理获取TLS会话Id?_Node.js_Nginx_Tls1.2 - Fatal编程技术网

Node.js 如何从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

在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;

}
当我尝试以请求头[X-tlsSessionId]的形式访问其他自定义头时,我可以访问其他自定义头,但不能访问X-tlsSessionId
我认为我使用小写字母来访问自定义标题,但这一个不起作用。

您可以尝试
console.log(req.headers)
查看发送到您的应用程序的所有标题server@slebetman很抱歉,刚才的评论。该标头不在req.headers中。我在服务器上做了console.log。不过我看到了其他标题。