I have an nginx from my client where I can POST successfully with:
curl -v --cacert ca.crt --cert client.crt --key client.key -POST https://nginx:8443/api/ -H 'Content-Type: application/json' -H 'cache-control: no-cache' -firstname.lastname@example.org
Now I installed an haproxy in front of nginx and I'm trying to do a POST the same way, unsuccessful:
curl -v --cacert ca.crt --cert client.crt --key client.key -POST http://haproxy:8443/api/ -H 'Content-Type: application/json' -H 'cache-control: no-cache' -email@example.com
<center>The plain HTTP request was sent to HTTPS port</center> <hr><center>nginx</center>
Here is my haproxy configuration:
I want to forward SSL traffic through HAProxy and pass the certificates for authentication to nginx. I know it doesn't make any sense to have two LBs but I can't modify nginx and the api server behind, but the clients will be internal. As you can see at this point I'm able to reach nginx but haproxy doesn't pass the certificates and keys from the request to nginx backend. Am I missing something? Is this something that I can achieve?
ps: If I'm setting 'ssl verify none' at backend, I'm getting 'No required SSL certificate was sent'. If I'm setting 'send-proxy' at backend, I'm getting '400 Bad Request' from nginx.