Files
mtusi2026lab3/infra/haproxy.cfg
T
PoRATL e0e1a1e6c1 Добавить балансировку и идемпотентность для лабораторной 3.
Две реплики API за HAProxy, общий PostgreSQL и повтор сообщения без дубля.
2026-11-13 07:30:46 +00:00

31 lines
660 B
INI

global
maxconn 200
defaults
mode http
timeout connect 1s
timeout client 10s
timeout server 2s
option httplog
option redispatch
retries 2
resolvers docker
nameserver dns 127.0.0.11:53
resolve_retries 3
timeout resolve 1s
timeout retry 1s
hold valid 1s
frontend http
bind *:80
default_backend api
backend api
balance roundrobin
option httpchk
http-check send meth GET uri /health/ready ver HTTP/1.1 hdr host localhost
http-check expect status 200
default-server inter 1s fall 1 rise 1
server-template api 4 api:8080 check resolvers docker init-addr none resolve-prefer ipv4