Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

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.

share|improve this answer
    
I thought as much, just wondered. Would be lovely to put in the backend server 5.6.7.8:variable rather than duplicate the set of servers for every backend just with different ports. –  Richard Benson May 1 '12 at 19:09
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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