Skip to content

Instantly share code, notes, and snippets.

@AndrewRussellHayes
Forked from johnfitzpatrick/haproxy.cfg
Created March 9, 2017 04:58
Show Gist options
  • Save AndrewRussellHayes/8742c36e9a9e64598254e934b9deb1d8 to your computer and use it in GitHub Desktop.
Save AndrewRussellHayes/8742c36e9a9e64598254e934b9deb1d8 to your computer and use it in GitHub Desktop.
global
log 127.0.0.1 local2
chroot /var/lib/haproxy
pidfile /var/run/haproxy.pid
maxconn 4000
user haproxy
group haproxy
daemon
stats socket /var/lib/haproxy/stats
defaults
mode http
log global
option httplog
option dontlognull
option http-server-close
option forwardfor except 127.0.0.0/8
option redispatch
retries 3
timeout http-request 10s
timeout queue 1m
timeout connect 10s
timeout client 1m
timeout server 1m
timeout http-keep-alive 10s
timeout check 10s
maxconn 3000
frontend main *:80
acl url_static path_beg -i /static /images /javascript /stylesheets
acl url_static path_end -i .jpg .gif .png .css .js
use_backend static if url_static
default_backend app
backend static
balance roundrobin
server static 127.0.0.1:4331 check
backend app
balance roundrobin
server app <<IP ADDRESS>>:80 weight 1 maxconn 100 check
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment