From 58593c6f044cb2dce1694d197e043b59cdcf238c Mon Sep 17 00:00:00 2001 From: jamesread Date: Thu, 6 Nov 2025 23:44:00 +0000 Subject: [PATCH] doc: Improve HAProxy example --- integration-tests/proxies/haproxy/Makefile | 2 ++ .../proxies/haproxy/haproxy.conf | 33 ++++++++++++++----- 2 files changed, 27 insertions(+), 8 deletions(-) create mode 100644 integration-tests/proxies/haproxy/Makefile diff --git a/integration-tests/proxies/haproxy/Makefile b/integration-tests/proxies/haproxy/Makefile new file mode 100644 index 00000000..506b99bd --- /dev/null +++ b/integration-tests/proxies/haproxy/Makefile @@ -0,0 +1,2 @@ +make: + haproxy -f ./haproxy.conf diff --git a/integration-tests/proxies/haproxy/haproxy.conf b/integration-tests/proxies/haproxy/haproxy.conf index 0528b780..705a3a6f 100644 --- a/integration-tests/proxies/haproxy/haproxy.conf +++ b/integration-tests/proxies/haproxy/haproxy.conf @@ -1,15 +1,32 @@ +global + stats socket /var/run/haproxy/admin.sock mode 660 level admin + log stdout local0 + + frontend cleartext_frontend - bind 0.0.0.0:80 + bind 0.0.0.0:8080 + timeout client 10s + + stats enable + stats uri /stats + stats refresh 30s + + log global option httplog + option dontlognull + log-format "[%t] %ci:%cp -> BACKEND:%b/%s | %HM %HU | Status:%ST | Bytes:%B" + mode http - use_backend be_olivetin_webs if { hdr(Host) -i olivetin.example.com && path_beg /websocket } - use_backend be_olivetin_http if { hdr(Host) -i olivetin.example.com } + use_backend be_olivetin if { hdr(Host) -i -m beg olivetin.example.com } -backend be_olivetin_http - server olivetinServer 127.0.0.1:1337 check - -backend be_olivetin_webs +backend be_olivetin + mode http + timeout connect 10s + timeout server 10s timeout tunnel 1h option http-server-close - server olivetinServer 127.0.0.1:1337 + http-request set-header X-Forwarded-User "Alice" + http-request set-header X-Forwarded-Group "Group1,Group2" + server olivetinServer 127.0.0.1:1337 check +