Hello,
I am trying to implement below HAproxy load balancer:
haproxy -v
HAProxy version 2.4.22-0ubuntu0.22.04.2 2023/08/14 - https://haproxy.org/
Status: long-term supported branch - will stop receiving fixes around Q2 2026.
Known bugs: http://www.haproxy.org/bugs/bugs-2.4.22.html
Running on: Linux 6.2.0-36-generic #37~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Mon Oct 9 15:34:04 UTC 2 x86_64
But facing following errors:
sudo haproxy -c -f /etc/haproxy/haproxy.cfg
[WARNING] (6071) : parsing [/etc/haproxy/haproxy.cfg:45] : backend ‘http_back’ : ‘option httplog’ directive is ignored in backends.
[WARNING] (6071) : parsing [/etc/haproxy/haproxy.cfg:56] : backend ‘http_fsmback’ : ‘option httplog’ directive is ignored in backends.
[NOTICE] (6071) : haproxy version is 2.4.22-0ubuntu0.22.04.2
[NOTICE] (6071) : path to executable is /usr/sbin/haproxy
[ALERT] (6071) : parsing [/etc/haproxy/haproxy.cfg:66] : unknown proxy mode ‘https’.
[WARNING] (6071) : parsing [/etc/haproxy/haproxy.cfg:68] : backend ‘https_back’ : ‘option tcplog’ directive is ignored in backends.
[ALERT] (6071) : parsing [/etc/haproxy/haproxy.cfg:78] : unknown proxy mode ‘https’.
[WARNING] (6071) : parsing [/etc/haproxy/haproxy.cfg:80] : backend ‘https_fsmback’ : ‘option tcplog’ directive is ignored in backends.
[ALERT] (6071) : Error(s) found in configuration file : /etc/haproxy/haproxy.cfg
[ALERT] (6071) : Fatal errors found in configuration.
Below is the config file:
global
log /dev/log local0
log /dev/log local1 notice
chroot /var/lib/haproxy
stats socket /run/haproxy/admin.sock mode 660 level admin expose-fd listeners
stats timeout 30s
user haproxy
group haproxy
daemon
Default SSL material locations
ca-base /etc/ssl/certs
crt-base /etc/ssl/private
See: Mozilla SSL Configuration Generator
ssl-default-bind-ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384
ssl-default-bind-ciphersuites TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256
ssl-default-bind-options ssl-min-ver TLSv1.2 no-tls-tickets
defaults
log global
option dontlognull
timeout connect 5000
timeout client 50000
timeout server 50000
errorfile 400 /etc/haproxy/errors/400.http
errorfile 403 /etc/haproxy/errors/403.http
errorfile 408 /etc/haproxy/errors/408.http
errorfile 500 /etc/haproxy/errors/500.http
errorfile 502 /etc/haproxy/errors/502.http
errorfile 503 /etc/haproxy/errors/503.http
errorfile 504 /etc/haproxy/errors/504.http
stats enable
stats realm Haproxy Statistics
stats uri /Haproxy_stats
stats auth admin:admin
frontend http_front
bind *:80
default_backend http_back
backend http_back
mode http
option httplog
balance roundrobin
server server101 10.10.24.101:80 check
server server102 10.10.24.102:80 check
frontend http_fsm
bind *:8080
default_backend http_fsmback
backend http_fsmback
mode http
option httplog
balance roundrobin
server server101 10.10.24.101:8080 check
server server102 10.10.24.102:8080 check
frontend https_front
bind *:443
default_backend https_back
backend https_back
mode https
option tcplog
balance roundrobin
server server101 10.10.24.101:443 check
server server102 10.10.24.102:443 check
frontend https_fsm
bind *:8080
default_backend https_fsmback
backend https_fsmback
mode https
option tcplog
balance roundrobin
server server101 10.10.24.101:8080 check
server server102 10.10.24.102:8080 check
This is the first time i am using HAProxy, Can anyone assist please, where i am doing wrong?
Thanks in Advance
Zaheer Ahmad