You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

在Nginx子请求中通过Lua传递客户端证书的问题排查

问题描述

我尝试通过ngx.location.capture将客户端证书传递至子请求,但使用以下Lua函数时,代理并未成功传递客户端证书。

相关Lua函数代码

local function checkAuthentication(userRole)
  return ngx.location.capture("/v1/auth/cert/login", {
    method = ngx.HTTP_POST,
    body = cjson.encode({ name = userRole }),
    share_all_vars = true,
    ctx = ngx.ctx,
  })
end

相关Nginx配置片段

server {
    ...
    ssl_verify_client optional_no_ca;

    location / {
      proxy_pass https://22.0.0.2:8200;
    }

    location /v1/pki/revoke {
        rewrite_by_lua_file /var/lua/revoke.lua;
        proxy_pass https://22.0.0.2:8200;
    }
}

内容的提问来源于stack exchange,提问作者Mime

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.20 19:48:25