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
    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.

  • I thought as much, just wondered. Would be lovely to put in the backend server rather than duplicate the set of servers for every backend just with different ports. – Richard Benson May 1 '12 at 19:09

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.