Running HAProxy with multiple SSL websites, and I would love to define a single backend (it's going to the same servers) but somehow specify the port to use on the backend in the front-end config, e.g.:
frontend front01_https
mode tcp
bind 1.2.3.4:443
default_backend https_cluster:1500
Trying mostly to tidy up my HAProxy config and make the stats more useful by combining the backends rather than having a backend for each front end or dropping down to listen
blocks.
You're not going to be able to do what you want, because a backend isn't a server, it's a destination -- which is both an address and a port.
With recent haproxy (1.5-dev), you can use the "use-server" directive to force use of a specific server. It saves you from creating as many backends as you have rules. You simply put the rules in the same backend and have all the servers at the same place. In your case you could even have a "listen" section with both the "bind" directive and the servers in it.