HAproxy configuration file. can’t view frontend.

my /etc/haproxy/haproxy.conf

log local2

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

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

mode                    http
log                     global
option                  httplog
option                  dontlognull
option http-server-close
option forwardfor       except
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 check port 80
bind *:80
mode http
default_backend application

backend application
balance     roundrobin
        server application1 check port 80
        server application2 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,


Leave a Reply