Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen Revision Vorhergehende Überarbeitung Nächste Überarbeitung | Vorhergehende Überarbeitung | ||
haproxy [2025/04/21 10:58] jango [Frontend] |
haproxy [2025/06/10 19:12] (aktuell) jango [HTTPS Termination] |
||
---|---|---|---|
Zeile 15: | Zeile 15: | ||
=====Konfiguration===== | =====Konfiguration===== | ||
+ | See also [[https:// | ||
====Global==== | ====Global==== | ||
Zeile 40: | Zeile 41: | ||
# Inherits mode | # Inherits mode | ||
frontend website | frontend website | ||
- | bind :80 | + | bind *:80 |
default_backend web_servers | default_backend web_servers | ||
Zeile 65: | Zeile 66: | ||
</ | </ | ||
+ | ===HTTPS Termination=== | ||
+ | |||
+ | Das Pem Zertifikat muss Cert und Privkey beinhalten! | ||
+ | |||
+ | <code bash> | ||
+ | certbot certonly --standalone -d vpn.zarat.at | ||
+ | certbot certonly --standalone -d sip.zarat.at | ||
+ | |||
+ | bash -c 'cat / | ||
+ | bash -c 'cat / | ||
+ | </ | ||
+ | |||
+ | <code bash> | ||
+ | frontend https_termination | ||
+ | mode tcp | ||
+ | bind *:443 ssl crt / | ||
+ | use_backend vpn if { req.hdr(host) -i vpn.zarat.at } | ||
+ | use_backend sip if { req.ssl_sni -i sip.zarat.at } | ||
+ | </ | ||
====Backend==== | ====Backend==== | ||
Zeile 72: | Zeile 92: | ||
frontend foo_and_bar | frontend foo_and_bar | ||
mode http | mode http | ||
- | bind :80 | + | bind *:80 |
use_backend foo_servers if { req.hdr(host) -i foo.com } | use_backend foo_servers if { req.hdr(host) -i foo.com } | ||
use_backend bar_servers if { req.hdr(host) -i bar.com | use_backend bar_servers if { req.hdr(host) -i bar.com | ||
Zeile 89: | Zeile 109: | ||
server bar2 192.168.1.36: | server bar2 192.168.1.36: | ||
server bar3 192.168.1.37: | server bar3 192.168.1.37: | ||
+ | </ | ||
+ | |||
+ | =====Stats===== | ||
+ | HAProxy hat ein Web Frontend zum Überwachen der Statistiken. | ||
+ | |||
+ | < | ||
+ | frontend stats | ||
+ | mode http | ||
+ | bind *:8404 | ||
+ | stats enable | ||
+ | stats refresh 10s | ||
+ | stats uri /stats | ||
+ | stats show-modules | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | http://< | ||
</ | </ |