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 1.9KB

1234567891011121314151617181920212223242526272829303132333435363738
  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 .Containers }}
  23. {{- if index .Labels "com.chameth.port" -}}
  24. {{- if index .Labels "com.chameth.vhost" }}
  25. use_backend {{ .Name }} if { hdr(host) -i {{ index .Labels "com.chameth.vhost" | split "," | join " || hdr(host) -i " }} }
  26. {{- end -}}
  27. {{- end -}}
  28. {{ end }}
  29. {{ range .Containers }}
  30. {{- if index .Labels "com.chameth.port" }}
  31. backend {{ .Name }}
  32. mode http
  33. server server1 {{ .Name }}:{{ index .Labels "com.chameth.port" }} check resolvers docker_resolver
  34. {{- end -}}
  35. {{ end }}