HaProxy - 502 Bad Gateway : HTTP spoken on HTTPS port

Solution 1:

You need to tell HAproxy that the backend server is using SSL:

server myserver-https x.x.x.x:443 ssl check verify none

The 'verify none' part tells haproxy not to verify the certificate chain. I've included it, but it may not be necessary.

You shouldn't need any of the header lines you indicated unless you want them.