Skip to content

Instantly share code, notes, and snippets.

@millken
Forked from anonymous/haproxy.cfg
Created January 25, 2016 14:15
Show Gist options
  • Save millken/15d86377925b1f0fe77b to your computer and use it in GitHub Desktop.
Save millken/15d86377925b1f0fe77b to your computer and use it in GitHub Desktop.
haproxy forward
global
log 127.0.0.1 local2
chroot /var/lib/haproxy
pidfile /var/run/haproxy.pid
maxconn 4000
user haproxy
group haproxy
daemon
defaults
mode http
log global
option dontlognull
option httpclose
#option httplog
option tcplog
#option forwardfor
option redispatch
timeout connect 10000 # default 10 second time out if a backend is not found
timeout client 300000
timeout server 300000
maxconn 60000
retries 3
frontend tcp-443-front
bind *:443
mode tcp
default_backend tcp-443-back
backend tcp-443-back
mode tcp
balance leastconn
server tcp-443 122.144.208.6:443
@millken
Copy link
Author

millken commented Jan 25, 2016

global
    daemon
    maxconn 32000

defaults
    mode http
    timeout connect 5000ms
    timeout client 50000ms
    timeout server 50000ms

listen http-in
    bind *:80
    server server1 1.1.1.1:8000 check
    server server2 1.1.1.1:8000 check

listen socketio-in
    mode tcp
    bind *:8080
    balance source
    timeout queue 5000
    timeout server 86400000
    timeout connect 86400000
    server server1 1.1.1.1:8080 check
    server server2  1.1.1.1:8080 check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment