Files
invidious/etc/haproxy/haproxy.cfg
T
2025-06-18 15:40:12 +02:00

96 lines
2.6 KiB
INI

global
log /dev/log local0
log /dev/log local1 notice
chroot /var/lib/haproxy
stats socket /run/haproxy/admin.sock mode 660 level admin
stats timeout 30s
user haproxy
group haproxy
maxconn 4000
daemon
defaults
log global
mode http
option httplog
option dontlognull
errorfile 400 /etc/haproxy/errors/400.http
errorfile 403 /etc/haproxy/errors/403.http
errorfile 408 /etc/haproxy/errors/408.http
errorfile 500 /etc/haproxy/errors/500.http
errorfile 502 /etc/haproxy/errors/502.http
#errorfile 502 /etc/haproxy/errors/502-invidious.http
errorfile 503 /etc/haproxy/errors/503.http
errorfile 504 /etc/haproxy/errors/504.http
timeout connect 10s
timeout check 10s
timeout client 15s
timeout server 15s
timeout http-request 30s
frontend statistics
bind :::8404 v4v6
mode http
http-request use-service prometheus-exporter if { path /metrics }
stats enable
stats uri /stats
stats refresh 30s
no log
frontend invidious
bind 192.42.6.1:8118
mode http
acl use_proxy_1 req.cook(COMPANION_ID) 0
acl use_proxy_2 req.cook(COMPANION_ID) 1
acl use_proxy_3 req.cook(COMPANION_ID) 2
acl use_proxy_4 req.cook(COMPANION_ID) 3
acl use_proxy_5 req.cook(COMPANION_ID) 4
acl use_proxy_6 req.cook(COMPANION_ID) 5
acl use_proxy_7 req.cook(COMPANION_ID) 6
acl use_proxy_8 req.cook(COMPANION_ID) 7
use_backend proxy_1 if use_proxy_1
use_backend proxy_2 if use_proxy_2
use_backend proxy_3 if use_proxy_3
use_backend proxy_4 if use_proxy_4
use_backend proxy_5 if use_proxy_5
use_backend proxy_6 if use_proxy_6
use_backend proxy_7 if use_proxy_7
use_backend proxy_8 if use_proxy_8
default_backend proxy_1
backend proxy_1
mode http
server server1 192.42.6.11:8282
backend proxy_2
mode http
server server2 192.42.6.12:8282
backend proxy_3
mode http
server server3 192.42.6.13:8282
backend proxy_4
mode http
server server4 192.42.6.14:8282
backend proxy_5
mode http
server server5 192.42.6.15:8282
backend proxy_6
mode http
server server6 192.42.6.16:8282
backend proxy_7
mode http
server server7 192.42.6.17:8282
backend proxy_8
mode http
server server8 192.42.6.18:8282