veza/config/incus/haproxy.cfg

85 lines
2.4 KiB
INI

global
log stdout format raw local0
maxconn 4096
daemon
defaults
log global
mode http
option httplog
option dontlognull
option forwardfor
option http-server-close
timeout connect 5000ms
timeout client 50000ms
timeout server 50000ms
timeout http-request 10000ms
# ============================================================================
# STATS & MONITORING
# ============================================================================
frontend stats
bind *:8404
stats enable
stats uri /stats
stats refresh 30s
stats admin if TRUE
# ============================================================================
# HTTP FRONTEND (Port 80)
# ============================================================================
frontend http_frontend
bind *:80
mode http
# ACLs for routing
acl is_api path_beg /api/v1
acl is_ws path_beg /ws
acl is_stream path_beg /stream
acl is_web path_beg /
# Route to appropriate backend
use_backend backend_api if is_api
use_backend chat_ws if is_ws
use_backend stream_ws if is_stream
use_backend web_frontend if is_web
# ============================================================================
# BACKENDS (Incus IP addresses)
# ============================================================================
# Backend API (Go) - veza-backend-api container
backend backend_api
mode http
balance roundrobin
option httpchk GET /api/v1/health
http-check expect status 200
server backend1 10.10.10.2:8080 check inter 5s fall 3 rise 2
# Chat WebSocket (Rust) - veza-chat-server container
backend chat_ws
mode http
balance roundrobin
option httpchk GET /health
http-check expect status 200
server chat1 10.10.10.3:8081 check inter 5s fall 3 rise 2
# WebSocket specific options
timeout tunnel 3600s
# Stream WebSocket (Rust) - veza-stream-server container
backend stream_ws
mode http
balance roundrobin
option httpchk GET /health
http-check expect status 200
server stream1 10.10.10.4:3002 check inter 5s fall 3 rise 2
# WebSocket specific options
timeout tunnel 3600s
# Web Frontend (Apache) - veza-web container
backend web_frontend
mode http
balance roundrobin
option httpchk GET /
http-check expect status 200
server web1 10.10.10.5:80 check inter 5s fall 3 rise 2