Skip to content
haproxy.cfg 1.14 KiB
Newer Older
Michiel de Jong's avatar
Michiel de Jong committed
global
  maxconn 4096
  user haproxy
  group haproxy

defaults
  mode http
  option forwardfor
  option httpclose
  option httplog
  option dontlognull
  retries 3
  timeout connect 5000
  timeout client 50000
  timeout server 50000

frontend https-in
mode http
  bind *:443 ssl crt-list /etc/haproxy/crt-list crt /etc/haproxy/approved-certs/default.pem
  reqadd X-Forwarded-Proto:\ https
    
# otherdomain.com:
  acl https_otherdomain.com hdr(host) -i otherdomain.com
  acl https_otherdomain.com hdr(host) -i www.otherdomain.com
  use_backend otherdomain.com if https_otherdomain.com
    
# michielbdejong.com:
  acl https_michielbdejong.com hdr(host) -i michielbdejong.com
  acl https_michielbdejong.com hdr(host) -i www.michielbdejong.com
  use_backend michielbdejong.com if https_michielbdejong.com
  
frontend http-in
  bind *:80
  redirect scheme https code 301
  
# michielbdejong.com:
backend michielbdejong.com
  cookie SERVERID insert nocache indirect
  server Server michielbdejong.com-backend:80 cookie Server
  
# otherdomain.com:
backend otherdomain.com
  cookie SERVERID insert nocache indirect
  server Server otherdomain.com-backend:80 cookie Server