lima-city: Webhosting, Domains und Cloud
1 Pluspunkt 0 Minuspunkte

Ich habe einen Linux Server mit HAProxy und darauf läuft unser Traffic zwischen Outlook und Exchange Server.

# /etc/haproxy/haproxy.cfg

global
    log /dev/log    local0
    log /dev/log    local1 notice
    chroot /var/lib/haproxy
    stats socket /run/haproxy/admin.sock mode 660 level admin expose-fd listeners
    stats timeout 30s
    user haproxy
    group haproxy
    daemon

    # Enable SSL passthrough
    tune.ssl.default-dh-param 2048

defaults
    log     global
    mode    tcp
    option  tcplog
    timeout connect 10s
    timeout client  1m
    timeout server  1m

listen stats
    bind *:8404
    mode http
    stats enable
    stats uri /stats
    stats realm Haproxy\ Statistics
    stats auth admin:admin
    stats refresh 10s

frontend exchange_ssl_frontend
    bind *:443
    mode tcp
    option tcplog
    default_backend exchange_ssl_backend

backend exchange_ssl_backend
    mode tcp
    balance source
    #option ssl-hello-chk
    server ex1 172.21.0.203:443 check
    server ex2 172.21.0.204:443 check

Wie kann ich damit einen weiteren Webservice proxien, der auch auf Port 443 (https) laufen soll?

von  

1 Antwort

0 Pluspunkte 0 Minuspunkte

Wenn du mehrere Dienste auf Port 443 über unterschiedliche Hostnamen (z. B. mail.mydomain.com, www.mydomain.com) loadbalancen möchtest, kannst du ein einziges Frontend verwenden und den Traffic je nach SNI (Server Name Indication) an verschiedene Backends weiterleiten. Ersetze deine Konfigurtation für das Exchange Frontend

frontend exchange_ssl_frontend
    bind *:443
    mode tcp
    option tcplog
    default_backend exchange_ssl_backend

durch eine TLS Passthru Konfiguration.

frontend tls_passthrough
    bind *:443
    mode tcp
    tcp-request inspect-delay 5s
    tcp-request content accept if { req.ssl_hello_type 1 }

    use_backend exchange_ssl_backend if { req.ssl_sni -i mail.mydomain.com }
    use_backend webserver_ssl_backend if { req.ssl_sni -i www.mydomain.com }

und füge ein weiteres Backend für den neuen Webservice hinzu.

backend webserver_ssl_backend
    mode tcp
    balance roundrobin
    server web1 <webserver1-ip>:443 check
    server web2 <webserver2-ip>:443 check
von (1.1k Punkte)