HAProxy configuration files for my self-hosted setup.
|
|
||
|---|---|---|
| 00global.cfg | ||
| 01defaults.cfg | ||
| 02cache.cfg | ||
| 03frontends.cfg | ||
| 04listen.cfg | ||
| 05backends.cfg | ||
| CLAUDE.md | ||
| goaccess.conf | ||
| LICENSE | ||
| README.md | ||
HAProxy
HAProxy configuration files for my self-hosted infrastructure.
Deployment
HAProxy loads all .cfg files from /etc/haproxy/config in order:
# /etc/systemd/system/haproxy.service.d/override.conf
[Service]
Environment="CONFIG=/etc/haproxy/config"
Files
| File | Purpose |
|---|---|
00global.cfg |
Global settings, TLS (Mozilla modern, TLS 1.3 only) |
01defaults.cfg |
Default timeouts, logging mode, error files |
02cache.cfg |
HTTP cache (128MB, 50MB max object, 24h TTL) |
03frontends.cfg |
HTTP/HTTPS frontend with scanner detection, rate limiting, geo-ACLs |
04listen.cfg |
TCP listen blocks for SSH, SMTP, SMTPS, IMAPS, Sieve |
05backends.cfg |
Backend definitions, DNS resolver, shared stick-tables |
goaccess.conf |
GoAccess config for parsing HAProxy logs |
Log analysis with GoAccess
The HTTP frontend logs in enriched httplog format (Referer, User-Agent, request ID appended). Logs are written to /var/log/haproxy.log via rsyslog.
# Terminal dashboard
goaccess /var/log/haproxy.log -p /etc/haproxy/config/goaccess.conf
# HTML report
goaccess /var/log/haproxy.log -p /etc/haproxy/config/goaccess.conf -o /tmp/report.html
Request IDs are logged at the end of each line for tracing:
grep 8d03b867-3521-4bce-8354-aabeaa097977 /var/log/haproxy.log
Quick reference
# Test configuration
haproxy -c -f /etc/haproxy/config/
# Reload (zero downtime)
systemctl reload haproxy
# View stats
curl http://localhost:8404/stats
# Admin socket
echo "show cache" | socat /run/haproxy/admin.sock -
echo "show table frontend_default" | socat /run/haproxy/admin.sock -