I want to pass a client certificate to a subrequest with ngx.location.capture
.
However, with the following function, the client certificate seems to doesn't not get passed by the proxy.
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
Relevant snippet from the nginx-configuration
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;
}
}