HAproxy configuration file. can’t view frontend.

my /etc/haproxy/haproxy.conf

global
log         127.0.0.1 local2

chroot      /var/lib/haproxy
pidfile     /var/run/haproxy.pid
maxconn     4000
user        root
group       root
daemon

# turn on stats unix socket
stats socket /var/lib/haproxy/stats level admin

 defaults
mode                    http
log                     global
option                  httplog
option                  dontlognull
option http-server-close
option forwardfor       except 127.0.0.0/8
option                  redispatch
retries                 3
timeout http-request    10s
timeout queue           1m
timeout connect         10s
timeout client          1m
timeout server          1m
timeout http-keep-alive 10s
timeout check           10s
maxconn                 3000

# enable stats uri
stats enable
stats uri /haproxy?stats

frontend loadbalancer
server loadbalancer 10.0.15.10 check port 80
bind *:80
mode http
default_backend application

backend application
balance     roundrobin
        server application1 10.0.15.21 check port 80
        server application2 10.0.15.22 check port 80

What I’m trying to do, is have the loadbalancer point to application1 or application2, in a roundrobin scenario.

I can see application1 and application2 by browsing to the ip in chrome, but can’t get it from going to the loadbalancer ip.

also, need help figuring out how to set a hostname to all of this.

Kind regards,
Ben

Related:


Leave a Reply