Newer
Older
global
log /dev/log local0 info
log /dev/log local0 notice
maxconn 4096
tune.ssl.default-dh-param 2048
ssl-default-bind-ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA
defaults
log global
mode http
option forwardfor
option httpclose
compression algo gzip
compression type text/html text/plain text/css application/javascript
frontend http-in
bind *:80
{{ range $host, $container := groupBy $ "Env.AUTOCONFIG_HOST" }}
redirect location https://{{ $host }}/mail/config-v1.1.xml code 301 if { hdr_beg(host) -i autoconfig }
{{end}}
bind *:443 ssl no-sslv3 crt /etc/haproxy/certs
reqadd X-Forwarded-Proto:\ https
rspadd Strict-Transport-Security:\ max-age=15768000
use_backend letsencrypt-web if { path_beg /.well-known/acme }
{{ range $host, $containers := groupBy $ "Env.LIBRESH_WEBHOOK_HOST" }}
use_backend webhook if { path_beg /XxosJDdRpo7Rww87VkJGzv1QLegnhh-uniq-libresh }
{{end}}
{{ range $host, $containers := groupByMulti $ "Env.VIRTUAL_HOST" "," }}
use_backend {{ $host}} if { hdr(host) -i {{ $host }} }
use_backend {{ $host}} if { hdr(host) -i {{ $host }}:443 }
{{ range $host, $containers := groupByMulti $ "Env.VIRTUAL_HOST" "," }}
backend {{ $host }}
{{ $networkLen := len $container.Networks }}
{{ if eq $networkLen 1 }}
{{ $network := index $container.Networks 0 }}
server Server {{ $network.IP }}:80 cookie Server
{{ else }}
{{ range $network := $container.Networks }}
{{ if eq $network.Name "lb_web" }}
server Server {{ $network.IP }}:80 cookie Server
{{end}}
{{end}}
{{end}}
{{ range $host, $containers := groupBy $ "Env.LIBRESH_WEBHOOK_HOST" }}
backend webhook
cookie SERVERID insert nocache indirect
server Server webhook:80 cookie Server
{{end}}