Support multiple backends per domain with the help of some lua

This commit is contained in:
Thomas Lynch
2023-04-06 22:40:03 +10:00
parent 35668c9b58
commit 40da57544a
4 changed files with 34 additions and 7 deletions

View File

@ -115,10 +115,13 @@ cache basic_cache
max-age 86400
backend servers
balance leastconn
# optional (recommended) ssl, requires CA cert installed on proxy and signeed cert on backends, you can also use "ssl verify none" but ssl can then be trivially mitm'd
# default-server ssl verify required ca-file ca-certificates.crt sni req.hdr(Host)
# use server based on hostname
use-server %[req.hdr(host),lower,map(/etc/haproxy/map/backends.map)] if TRUE
#use-server %[req.hdr(host),lower,map(/etc/haproxy/map/backends.map)] if TRUE
# use multiple servers with lua
use-server %[lua.get_server_names] if TRUE
backend bot_check_post_throttle
stick-table type ipv6 size 100k expire 60s store http_req_rate(60s)