Skip to content

Instantly share code, notes, and snippets.

@johnfitzpatrick
Created May 26, 2015 21:12
Show Gist options
  • Save johnfitzpatrick/8a59a3251e976cf9a716 to your computer and use it in GitHub Desktop.
Save johnfitzpatrick/8a59a3251e976cf9a716 to your computer and use it in GitHub Desktop.
haproxy.cfg.erb
global
log 127.0.0.1 local0
log 127.0.0.1 local1 notice
#log loghost local0 info
maxconn 4096
user haproxy
group haproxy
stats socket /var/run/haproxy.sock user haproxy group haproxy
defaults
log global
mode http
retries 3
timeout client 50s
timeout connect 5s
timeout server 50s
option dontlognull
option httplog
option redispatch
balance roundrobin
frontend http
maxconn 2000
bind 0.0.0.0:80
default_backend servers-http
backend servers-http
mode http
<% @pool_members.each do |member| -%>
server <%= member[:hostname] %> <%= member[:ipaddress] %>:<%= node["myapache"]["port"] %> weight 1 maxconn 1 check
<% end -%>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment