Skip to content

Instantly share code, notes, and snippets.

@arunoda
Last active December 31, 2015 00:29
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save arunoda/a35f69f8b7a385d06a8d to your computer and use it in GitHub Desktop.
Save arunoda/a35f69f8b7a385d06a8d to your computer and use it in GitHub Desktop.
Haproxy Config File
global
quiet
stats socket /var/run/haproxy.sock level admin
#make sure there is an unpreviledged user named "haproxy"
user haproxy
group haproxy
defaults
maxconn 20000
log global
mode http
retries 3
option redispatch
option http-server-close
timeout connect 60s
timeout server 60s
timeout client 60s
timeout check 5s
frontend public
#binding port 80
bind *:80
default_backend apps
backend apps
#load balancing algorithm
balance leastconn
#using JSESSIONID as the cookie
cookie JSESSIONID insert nocache
#adding server
server host1 host1.example.com cookie host1
server host2 host2.example.com cookie host2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment