1

In all use cases I could find, HAProxy is running on a different server than the content server, e.g.:

Instance 1 - Load Balancer Hostname: haproxy IP: 192.168.205.15

Instance 2 - Web Server 1 Hostname: webser01 IP: 192.168.205.16

Instance 2 - Web Server 2 Hostname: webserver02 IP: 192.168.205.17

Is it possible to run HAProxy (together with nginx e.g.) on one of the content server and how would the configuration be?

4
  • 2
    It is possible but then if the machine with haproxy + nginx goes down the second webserver is not accessible anymore, so you dont have HA
    – Fredi
    Oct 5, 2016 at 13:41
  • Are you sure? Because then the IP of instance 1 and one of the other instances are the same... Does this not lead to problems?
    – Barmi
    Oct 8, 2016 at 22:27
  • 1
    Nope, obviously you will use different ports for different services, example: first server, IP 192.168.0.1 haproxy on port 443, nginx on port 444, second server, IP 192.168.0.2 haproxy on port 443, nginx on port 444
    – Fredi
    Oct 10, 2016 at 10:22
  • Ok... that's worth a try. Thanks for your answer :)
    – Barmi
    Oct 11, 2016 at 14:28

1 Answer 1

1

The configuration is the same as it was on a single node.

A minimal configuration can be:

frontend www-http
    bind *:80
    default_backend apache

backend apache
    mode http
    balance roundrobin
    server web1 10.0.0.1:8080
    server web2 10.0.0.2:8080

The Problem is the redundancy. With only one haproxy you have no high availability. HAProxy on both web server + keepalived could be a solution...

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .