Skip to content

Instantly share code, notes, and snippets.

@stevepereira
Created August 15, 2014 16:05
Show Gist options
  • Save stevepereira/ec82353c34e1d20d0dce to your computer and use it in GitHub Desktop.
Save stevepereira/ec82353c34e1d20d0dce to your computer and use it in GitHub Desktop.
HAPROXY SSL reference
global
log 127.0.0.1 local0
log 127.0.0.1 local1 notice
maxconn 4096
user haproxy
group haproxy
daemon
defaults
log global
mode http
option httplog
option dontlognull
option forwardfor
option http-server-close
stats enable
stats auth someuser:somepassword
stats uri /haproxyStats
frontend http-in
bind *:80
reqadd X-Forwarded-Proto:\ http
default_backend application-backend
frontend https-in
bind *:443 ssl crt /etc/ssl/*ssl key*
reqadd X-Forwarded-Proto:\ https
default_backend application-backend
backend application-backend
redirect scheme https if !{ ssl_fc }
balance leastconn
option httpclose
option forwardfor
cookie JSESSIONID prefix
#enter the IP of your application here
server node1 10.0.0.1 cookie A check
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment