Skip to main content

Primary links

  • Home
  • AI
  • Kubernetes
  • Incus
  • Ansible
  • Terraform
  • OpenStack
  • Virtualization
  • Linux
  • SmartHome
  • HowTo

Misc

  • Linux
  • Hardware
  • Programming
  • Databases
  • Multimedia
  • Windows

Cloud

  • OpenStack
  • cloud-config
  • nextcloud

Virtualization

  • Virtualization
  • Incus
  • Docker
  • KVM
  • Kubernetes
  • LXC
  • LXD
  • QEMU
  • VMware
  • VirtualBox
  • multipass
  • podman
  • vagrant
  • XEN

Network

  • DNS
  • Firewall
  • Linux
  • OpenvSwitch
  • SSL
  • VLAN
  • VPN
  • iPXE
  • namespaces
  • nmcli
  • tcpdump

Storage

  • CEPH
  • DRBD
  • LVM
  • S3
  • ZFS
  • btrfs

Automation / CI/CD

  • Install
    • bind9 named
    • NX Client
    • FreeNX Server
    • Archive
    • Asterisk
    • Audio Recorder
    • Build essential
    • Chromium
    • Couch DB
    • DMA
    • DVD
    • Dovecot
    • Eclipse
    • FTP server
    • Firefox
    • GWT
    • Games
    • Gimp
    • Glassfish
    • Gnome classic
    • Google Music Manager
    • HAproxy
    • HTTrack
    • Hibiscus
    • Icinga
    • Install Cinnamon
    • Install thttpd
    • Install vivaldi
    • Java JDK
    • Jenkins
    • Kodi
    • LTSP
    • LXC
    • LibreOffice
    • Mailserver
    • MariaDB
    • Microsoft teams
    • MiniDLNA
    • Mosquitto MQTT server
    • MySQL Connector/J
    • MySQL Server
    • MySQL Workbench
    • Nemo
    • NetBeans
    • Node-RED
    • Obnam
    • OpenElec PXE
    • OpenFortiGUI
    • Oracle XE
    • Postfix
    • ProjectLibre
    • Proton VPN
    • Proton VPN
    • Roundcubemail
    • Ruby on Rails
    • Rundeck
    • SQL Developer
    • SQuirreL SQL
    • Scribus
    • Skype
    • SonarQube
    • Spotify
    • Squid
    • SteuerSparErklärung
    • TeamViewer
    • Thunderbird
    • Tipp10
    • Tomcat
    • Ubuntu restricted extras
    • UnixBench
    • VLC player
    • VMware Player
    • Vega
    • VirtualBox
    • Visual Studio Code
    • Webserver
    • Wine
    • WordPress
    • apt-cacher-ng
    • autofs
    • avidemux
    • ckeditor
    • consul
    • ddrescue
    • duplicity
    • easytax
    • gbrainy
    • gitea
    • gnokii
    • gogs
    • gopenvpn
    • hddtemp
    • homebridge
    • iSCSI
    • jitsi
    • lm-sensors
    • mattermost
    • myTinyTodo
    • neatx
    • netdata
    • nullmailer
    • openproject
    • phpMyAdmin
    • pip
    • pipelight
    • proftpd
    • prometheus
    • pyenv
    • rTorrent
    • restic
    • rustdesk
    • smartmontools
    • snap
    • speedtest
    • sshuttle
    • stress test
    • syslinux
    • tftp server
    • tinyproxy
    • topgrade
    • uShare
    • x2go
  • Ansible
  • GitLab
  • LLM
  • Preseed
  • Puppet
  • Terraform
  • Ubuntu autoinstall

Monitoring / Visualisation

  • Grafana
  • Icinga
  • Prometheus
  • Monitoring
  • ELK
  • mermaid
  • network
  • linux
  • loadbalancer

Install
https://haproxy.debian.net/#?distribution=Ubuntu&release=focal&version=2.1

sudo apt install -y haproxy

Check status

systemctl status haproxy

Include configurations from /etc/haproxy/haproxy.cfg directory

sed -i 's|[#]*CONFIG=.*|CONFIG=/etc/haproxy/haproxy.cfg.d|g' /etc/default/haproxy
service haproxy restart

Check configuration / Debug

haproxy -c -f /etc/haproxy/haproxy.cfg
service haproxy reload
tail -f /var/log/haproxy.log

Loadbalancer
http://www.loadbalancer.org/blog/category/haproxy/

Prometheus
https://www.haproxy.com/blog/haproxy-exposes-a-prometheus-metrics-endpoint/

ACL

acl valid-ua hdr(user-agent) -f exact-ua.lst -i -f generic-ua.lst test
http://cbonte.github.io/haproxy-dconv/1.8/configuration.html#7
https://www.haproxy.com/de/blog/introduction-to-haproxy-acls/

Configuration

/etc/haproxy/haproxy.cfg

...
frontend www1
    bind :80
    mode http
    acl whitelist src -f /etc/haproxy/whitelist.lst
    acl all src 0.0.0.0
    use_backend backend1 if whitelist

backend backend1
    mode http
    balance roundrobin
    option forwardfor
    http-request set-header X-Forwarded-Port %[dst_port]
    http-request add-header X-Forwarded-Proto https if { ssl_fc }
    option httpchk HEAD / HTTP/1.1rnHost:localhost
    server web1.example.com 10.0.1.10:80
    server web2.example.com 10.0.1.11:80
    server web3.example.com 10.0.1.12:80

listen stats 
    bind :9000
    mode http
    stats enable
    stats hide-version
    stats realm Haproxy\ Statistics
    stats refresh 30s
    stats show-node
    stats auth admin:password
    stats uri /

ACL whiterlist

/etc/haproxy/whitelist.lst

# server 1
192.168.1.1/32
# net 1
10.182.29.0/24

SSL

...
frontend public
    bind :80
    bind :443 ssl crt /etc/haproxy/ssl
...

Docker
http://www.panticz.de/docker/haproxy

Letsencrypt
https://gridscale.io/community/tutorials/haproxy-ssl/
https://www.haproxy.com/blog/haproxy-and-let-s-encrypt

Logging
https://www.haproxy.com/de/blog/introduction-to-haproxy-logging/
https://stackoverflow.com/questions/59374512/how-to-configure-haproxy-to-log-in-tcp-mode

defaults
   log global
   mode tcp
   option tcplog
   option logasap

Gracefuly restart

# check HAproxy configuration
haproxy -c -f /var/lib/octavia/caa5050a-08a1-412e-9294-a544eda00bbf/haproxy.cfg

pgrep -a haproxy

/usr/sbin/haproxy -Ws -f /var/lib/octavia/caa5050a-08a1-412e-9294-a544eda00bbf/haproxy.cfg -f /var/lib/octavia/haproxy-default-user-group.conf -p /var/lib/octavia/caa5050a-08a1-412e-9294-a544eda00bbf/caa5050a-08a1-412e-9294-a544eda00bbf.pid -L LezrlmqomNp6s6uOJE5YX5bF9Ac -sf $(cat /var/lib/octavia/caa5050a-08a1-412e-9294-a544eda00bbf/caa5050a-08a1-412e-9294-a544eda00bbf.pid) &

tail -f /var/log/haproxy.log

Documentation
https://cbonte.github.io/haproxy-dconv/2.3/configuration.html

HAProxy-WI (web interface)
https://haproxy-wi.org/
https://haproxy-wi.org/docker.py

keepalived

keepalived -f /etc/keepalived/keepalived.conf --dont-fork --log-console --log-detail

Cache
https://www.haproxy.com/documentation/haproxy-configuration-tutorials/network-performance/caching/

ACLs
https://www.haproxy.com/documentation/haproxy-configuration-tutorials/core-concepts/acls/

Links
https://chase-seibert.github.io/blog/2011/02/26/haproxy-quickstart-w-full-example-config-file.html
https://github.com/jiangwenyuan/nuster
https://www.haproxy.com/blog/haproxy-2-0-and-beyond/#prometheus-exporter
https://www.haproxy.com/blog/exploring-the-haproxy-stats-page

Profiles GitHub StackOverflow LinkedIn Xing
Contact Imprint
© panticz 2026

Cookie-Einstellungen

Diese Website nutzt eingebettete Inhalte von Drittanbietern (z.B. YouTube, SoundCloud). Beim Laden dieser Inhalte werden Daten an die jeweiligen Anbieter übermittelt. Datenverarbeitungserklärung