Docker template generator
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

haproxy.cfg.tpl 2.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. global
  2. ssl-default-bind-ciphers ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256
  3. ssl-default-bind-options no-sslv3 no-tlsv10 no-tlsv11 no-tls-tickets
  4. ssl-default-server-ciphers ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256
  5. ssl-default-server-options no-sslv3 no-tlsv10 no-tlsv11 no-tls-tickets
  6. resolvers docker_resolver
  7. nameserver dns 127.0.0.11:53
  8. defaults
  9. log global
  10. mode http
  11. timeout connect 5000
  12. timeout client 5000
  13. timeout server 5000
  14. compression algo gzip
  15. compression type text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript
  16. frontend main
  17. mode http
  18. bind :443 ssl strict-sni alpn h2,http/1.1 crt /certs/certs/chameth.com/combined.pem
  19. bind :80
  20. redirect scheme https code 301 if !{ ssl_fc }
  21. http-response set-header Strict-Transport-Security max-age=15768000
  22. {{- range .Hostnames }}
  23. use_backend {{ .Name | replace "." "_" }} if {hdr(host) -i {{ .Name }}
  24. {{- range $san, $_ := .Alternatives }} || hdr(host) -i {{ $san }} {{- end -}}
  25. }
  26. {{- end -}}
  27. {{ range .Hostnames }}
  28. backend {{ .Name | replace "." "_" }}
  29. mode http
  30. {{- range .Containers }}
  31. {{- if index .Labels "com.chameth.proxy" }}
  32. server server1 {{ .Name }}:{{ index .Labels "com.chameth.proxy" }} check resolvers docker_resolver
  33. {{- end -}}
  34. {{- end -}}
  35. {{- if .RequiresAuth }}
  36. acl authed_{{ .Name | replace "." "_" }} http_auth({{ .AuthGroup }})
  37. http-request auth if !authed_{{ .Name | replace "." "_" }}
  38. {{- end -}}
  39. {{ end }}