2.4 KiB
2.4 KiB
Zentraler Reverse Proxy Für ehemals öffentliche IP-Adressen
Die Instanzen können weitestgehend unverändert weiterlaufen, es müssen nur alle DNS-Einträge auf 141.56.51.1 geändert werden.
HAProxy
Zum Weiterleiten der Connections wird HAProxy verwendet. HAProxy unterstützt verschiedene Modi. 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
...
...
...