HAProxy Umsetzung Linux - Netzwerk Serveradministration

Aus Xinux Wiki
Zur Navigation springen Zur Suche springen
sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 \
    -keyout /etc/ssl/private/wildcard.it113.int.key \
    -out /etc/ssl/certs/wildcard.it113.int.crt \

sudo cat /etc/ssl/certs/wildcard.it113.int.crt /etc/ssl/private/wildcard.it113.int.key > wildcard.it113.int.pem
  • vim /etc/haproxy/haproxy.cfg

HA Proxy HTTP

frontend https_web_services
 bind 10.0.1xx.2:443 name localhost_443 ssl crt /etc/haproxy/server.pem
 timeout client 50000
 mode http
 acl acl_web1 hdr_beg(host) -i web1
 acl acl_web2 hdr_beg(host) -i web2
 use_backend backend_web1 if acl_web1
 use_backend backend_web2 if acl_web2
 default_backend http_backend

#frontend https_frontend
# bind 10.0.1xx.2:443 name localhost_443 ssl crt /etc/haproxy/server.pem
# timeout client 50000
# default_backend http_backend

backend backend_web1
 timeout connect 5000
 timeout server 50000
 mode http
 server web_dns 10.0.1xx.2:80 check

backend backend_web2
 timeout connect 5000
 timeout server 50000
 mode http
 server web_ldap 10.0.1xx.3:80 check

backend http_backend
 mode http
 balance roundrobin
 timeout connect 5000
 timeout server 50000
 server web_dns_2 10.0.1xx.2:80 check
 server web_ldap_2 10.0.1xx.3:80 check