From 23384f57daa0f6de81c4bae776c360b19a014b8e Mon Sep 17 00:00:00 2001 From: goeranh Date: Wed, 25 Feb 2026 20:50:23 +0100 Subject: [PATCH] haproxy config snippet in readme --- hosts/proxy/README.md | 58 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/hosts/proxy/README.md b/hosts/proxy/README.md index 06f204b..d0de123 100644 --- a/hosts/proxy/README.md +++ b/hosts/proxy/README.md @@ -8,3 +8,61 @@ Für uns sind http und tcp relevant. Unverschlüsselte Verbindungen werden mit dem http Modul geparst und weitergeleitet. Bei SSL-Verbindungen wird beim Session-Aufbau der Hostname beobachtet und anhand dessen, die komplette verschlüsselte Verbindung an das jeweilige System weitergeletet. Damit können alle Systeme weiterhin selbst mit certbot ihre TLS-Zertifikate anfordern, da auch die ACME-Challenge weitergeleitet wird. + +### Config + +Relevant HAProxy config: + +``` +frontend http-in + bind *:80 + + acl is_cloud hdr(host) -i cloud.htw.stura-dresden.de + acl is_dat hdr(host) -i dat.htw.stura-dresden.de + acl is_plone hdr(host) -i stura.htw-dresden.de + acl is_plone_alt hdr(host) -i www.stura.htw-dresden.de + acl is_pro hdr(host) -i pro.htw.stura-dresden.de + acl is_tix hdr(host) -i tix.htw.stura-dresden.de + acl is_vot hdr(host) -i vot.htw.stura-dresden.de + acl is_wiki hdr(host) -i wiki.htw.stura-dresden.de + + + use_backend cloud_80 if is_cloud + use_backend dat_80 if is_dat + use_backend plone_80 if is_plone + use_backend plone_alt_80 if is_plone_alt + use_backend pro_80 if is_pro + use_backend tix_80 if is_tix + use_backend vot_80 if is_vot + use_backend wiki_80 if is_wiki + + + default_backend plone_80 + +frontend sni_router + bind *:443 + mode tcp + tcp-request inspect-delay 1s + tcp-request content accept if { req_ssl_hello_type 1 } + + use_backend cloud_443 if { req_ssl_sni -i cloud.htw.stura-dresden.de } + use_backend dat_443 if { req_ssl_sni -i dat.htw.stura-dresden.de } + use_backend plone_443 if { req_ssl_sni -i stura.htw-dresden.de } + use_backend plone_alt_443 if { req_ssl_sni -i www.stura.htw-dresden.de } + use_backend pro_443 if { req_ssl_sni -i pro.htw.stura-dresden.de } + use_backend tix_443 if { req_ssl_sni -i tix.htw.stura-dresden.de } + use_backend vot_443 if { req_ssl_sni -i vot.htw.stura-dresden.de } + use_backend wiki_443 if { req_ssl_sni -i wiki.htw.stura-dresden.de } + + +# this block is repeated for each backend +backend cloud_80 + mode http + server cloud 141.56.51.16:80 # no check here - also proxy if haproxy thinks this is down +backend cloud_443 + mode tcp + server cloud 141.56.51.16:443 check +... +... +... +```