Files
mtusi2026lab3/infra/haproxy.cfg
T

44 lines
1.2 KiB
INI

global
log stdout format raw local0
maxconn 4096
defaults
log global
mode http
option httplog
option dontlognull
option http-keep-alive
timeout connect 500ms
timeout client 15s
timeout server 15s
timeout http-request 5s
timeout http-keep-alive 5s
timeout check 1s
retries 2
resolvers docker
nameserver dns 127.0.0.11:53
resolve_retries 3
timeout resolve 1s
timeout retry 1s
hold other 2s
hold refused 2s
hold nx 2s
hold timeout 2s
hold valid 2s
hold obsolete 2s
frontend public
bind *:8080
# Публичный live — процесс точки входа. Ready и бизнес-трафик идут на API.
http-request return status 200 content-type application/json hdr X-Request-Id "lb-live" hdr X-Instance-Id "load-balancer" string "{\"status\":\"ok\"}" if { path /health/live }
default_backend api
backend api
balance roundrobin
option httpchk
http-check send meth GET uri /health/ready ver HTTP/1.1 hdr Host api
http-check expect status 200
default-server inter 1s fall 2 rise 1 resolvers docker resolve-prefer ipv4 init-addr none
server-template api 4 api:8080 check