Skip to content

Instantly share code, notes, and snippets.

@mafonso
Created June 18, 2018 11:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mafonso/4cfef9b2026f681bad051409788a31c8 to your computer and use it in GitHub Desktop.
Save mafonso/4cfef9b2026f681bad051409788a31c8 to your computer and use it in GitHub Desktop.
HAProxy examples
frontend app1_ssl
bind *:443 ssl crt /etc/haproxy/certs.d/example.com.crt crt /etc/haproxy/certs.d/ no-sslv3
option http-server-close
option forwardfor
reqadd X-Forwarded-Proto:\ https
reqadd X-Forwarded-Port:\ 443
# set HTTP Strict Transport Security (HTST) header
rspadd Strict-Transport-Security:\ max-age=15768000
# some ACLs and URL rewrites...
default_backend backend_app1_ssl
backend backend_app1_ssl
server mybackendserver 127.0.01:4433 ssl verify none
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment