Benutzer-Werkzeuge

Webseiten-Werkzeuge


haproxy

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen Revision Vorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
haproxy [2025/04/21 10:59]
jango [Konfiguration]
haproxy [2025/06/10 19:12] (aktuell)
jango [HTTPS Termination]
Zeile 15: Zeile 15:
 =====Konfiguration===== =====Konfiguration=====
  
-See also [[https://www.haproxy.com/documentation/haproxy-configuration-tutorials/proxying-essentials/configuration-basics/overview/|HAProxy configuration basics]]+See also [[https://www.haproxy.com/documentation/haproxy-configuration-tutorials/|HAProxy configuration tutorials]]
 ====Global==== ====Global====
  
Zeile 41: Zeile 41:
 # Inherits mode # Inherits mode
 frontend website frontend website
-  bind :80+  bind *:80
   default_backend web_servers   default_backend web_servers
  
Zeile 66: Zeile 66:
 </code> </code>
  
 +===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 /etc/letsencrypt/live/vpn.zarat.at/fullchain.pem /etc/letsencrypt/live/vpn.zarat.at/privkey.pem > /etc/ssl/private/vpn.zarat.at.pem'
 +bash -c 'cat /etc/letsencrypt/live/sip.zarat.at/fullchain.pem /etc/letsencrypt/live/sip.zarat.at/privkey.pem > /etc/ssl/private/sip.zarat.at.pem'
 +</code>
 +
 +<code bash>
 +frontend https_termination
 +  mode tcp
 +  bind *:443 ssl crt /etc/ssl/private/
 +  use_backend vpn if { req.hdr(host) -i vpn.zarat.at }
 +  use_backend sip if { req.ssl_sni -i sip.zarat.at }
 +</code>
 ====Backend==== ====Backend====
  
Zeile 73: 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 90: Zeile 109:
   server bar2 192.168.1.36:80 check   server bar2 192.168.1.36:80 check
   server bar3 192.168.1.37:80 check   server bar3 192.168.1.37:80 check
 +</code>
 +
 +=====Stats=====
 +HAProxy hat ein Web Frontend zum Überwachen der Statistiken.
 +
 +<code>
 +frontend stats
 +  mode http
 +  bind *:8404
 +  stats enable
 +  stats refresh 10s
 +  stats uri /stats
 +  stats show-modules
 +</code>
 +
 +<code>
 +http://<server>:8404/stats
 </code> </code>
haproxy.1745225972.txt.gz · Zuletzt geändert: 2025/04/21 10:59 von jango