Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen Revision Vorhergehende Überarbeitung Nächste Überarbeitung | Vorhergehende Überarbeitung | ||
haproxy [19/01/2020 - 09:54] – thommie3 | haproxy [17/08/2024 - 07:06] (aktuell) – Externe Bearbeitung 127.0.0.1 | ||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
====== Allgemeine Konfiguration ====== | ====== Allgemeine Konfiguration ====== | ||
- | [[https:// | + | [[http:// |
+ | |||
+ | Konfiguration verifizieren | ||
+ | |||
+ | < | ||
+ | /usr/ | ||
+ | </ | ||
+ | |||
+ | ====== Aktuelle Versionen ====== | ||
+ | |||
+ | https://haproxy.debian.net/ | ||
+ | |||
+ | (Standard Focal hat nur V. 2.0) | ||
====== HAPROXY als SSL Accelerator ====== | ====== HAPROXY als SSL Accelerator ====== | ||
- | Vorteil: **keine separaten IP Adressen nötig!** Konzept: HAPROXY horcht auf 80 und 443, der Webserver horcht nur auf localhost, z.B: 127.0.0.1: | + | Vorteil: **keine separaten IP Adressen nötig!** Konzept: HAPROXY horcht auf 80 und 443, der Webserver horcht nur auf localhost, z.B: 127.0.0.1: |
+ | ===== frontend | ||
+ | < | ||
frontend default | frontend default | ||
Zeile 55: | Zeile 70: | ||
===== Konfiguration HAPROXY ===== | ===== Konfiguration HAPROXY ===== | ||
- | **frontend**< | + | **frontend** |
+ | < | ||
frontend le-frontend | frontend le-frontend | ||
Zeile 95: | Zeile 111: | ||
</ | </ | ||
- | ===== Erneuern =====< | ||
- | '' | + | ===== Erneuern ===== |
+ | Zertifikate werden über –force-renewal einmal pro Monat per cron über ein Shellscrip aktualisiert und neu zusammengebunden | ||
+ | < | ||
+ | |||
+ | # | ||
+ | |||
+ | # Renew the certificate | ||
+ | certbot renew --force-renewal --tls-sni-01-port=8888 | ||
+ | |||
+ | # Concatenate new cert files, with less output (avoiding the use tee and its output to stdout) | ||
+ | bash -c "cat / | ||
+ | bash -c "cat / | ||
+ | |||
+ | # Reload | ||
+ | service haproxy reload | ||
+ | |||
+ | </ | ||
+ | |||
+ | ====== Domain Umleitung (301) ====== | ||
+ | |||
+ | < | ||
+ | acl demoredirect hdr_dom(host) -i demofolder.com | ||
+ | acl demoredirect hdr_dom(host) -i www.demofolder.com | ||
+ | http-request redirect location https:// | ||
</ | </ | ||