Nginx – client authentication when using nginx proxy_pass

nginx

My question is about nginx directive "proxy_pass".

I have an http server and I need to redirect requests using https.
I'm using the following statement:
proxy_pass https://secure.server
In wireshark I see that there is a SSL handshake, but client (nginx proxy_pass https:) did not send certificate on server's SSL certificate request.
Verifying client certificate is necessary by server. How can I force proxy_pass to send client certificate when using https ?
Below is part of nginx.conf configuration file:

server {
    listen  8888;
    server_name     _;
    error_page 405 =200 $uri;
    ssl_certificate       /usr/local/cert.pem;
    ssl_certificate_key   /usr/local/cert.pem                                          
    ssl_client_certificate  /usr/local/ca.cer;       

    location ~ /uri/(.+) {

                    proxy_pass https://secure.server;
                    break;
            }

    }

Best Answer

You need to enable SSL client certificate verification.

Add this under the other SSL configurations:

ssl_verify_client on;

See more information here.

Related Topic