Article 542BD HAProxy - routing multiple domains over ssl

HAProxy - routing multiple domains over ssl

by
dr-ing
from LinuxQuestions.org on (#542BD)
Hey,

I have 2 almost similar local web servers (e.g. alpha:10.0.0.1 & beta:10.0.0.2) and currently only one (alpha) is used. I want to use the second server now and although the transfer itself is not a problem, I need some kind of reverse proxy that decides which (sub-)domain belongs to which local webserver, since the domains themselves should still point to the same public IP. Since I have a lot of domains on the web server, the reverse proxy should have a ssl pass-through option, and so HAproxy comes to mind.

I wrote this (simple) config:
Code:global
daemon
maxconn 256
log /dev/log local0 debug
defaults
option httplog
timeout connect 5000ms
timeout client 50000ms
timeout server 50000ms
frontend http_in
mode tcp
bind *:80
bind *:443
acl alpha hdr(host) -i alpha.example.com
acl beta hdr(host) -i beta.example.com
use_backend alpha if alpha
use_backend beta if beta
backend alpha
mode tcp
server alpha 192.168.1.109:443 check
backend beta
mode tcp
server gamma 10.0.0.2:443 checkwhich, unfortunately, is not working.
When I call the page on via browser, the following message appears:
Code:This site can't be reached
alpha.example.com unexpectedly closed the connection.
Try:

Checking the connection
Checking the proxy and the firewall
ERR_CONNECTION_CLOSEDwhile Code:curl https://alpha.example.com returns following:
Code:curl: (35) OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to alpha.example.com:443Does anyone have more experience with HAproxy and can help me with this?

Thank you,
dr-ing

EDIT:
This is what Firefox returns:
Code:Secure Connection Failed

An error occurred during a connection to alpha.example.com. PR_END_OF_FILE_ERROR

The page you are trying to view cannot be shown because the authenticity of the received data could not be verified.
Please contact the website owners to inform them of this problem.latest?d=yIl2AUoC8zA latest?i=VAonjBEvisQ:GreKEnSrL48:F7zBnMy latest?i=VAonjBEvisQ:GreKEnSrL48:V_sGLiP latest?d=qj6IDK7rITs latest?i=VAonjBEvisQ:GreKEnSrL48:gIN9vFwVAonjBEvisQ
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments