haproxy acl hdr_beg(host)

Опубликовано: 16 Июль 2026
на канале: Direto ao Ponto Notícias
466
9

Regra baseada em DNS.


Configuração Haproxy:
frontend ENTRADA
bind :::8080
mode http
stats uri /haproxy?stats
acl app-sitea hdr_beg(host) -i testea # for http://app1.domain.com
acl app-siteb hdr_beg(host) -i testeb # for http://app1.domain.com

use_backend PSITEA if app-sitea
use_backend PSITEB if app-siteb

backend PSITEA
balance roundrobin
option forwardfor
server SRVA 192.168.0.104:80 check



backend PSITEB
balance roundrobin
option forwardfor
server SRVB 192.168.0.108:80 check

dashboard ##
listen stats
bind :32600
stats enable
stats uri /
stats hide-version
stats auth haproxy:a123456