Skip to content

Instantly share code, notes, and snippets.

@rk295
Created October 8, 2018 13:24
Show Gist options
  • Save rk295/1ade6cf3a069d072c05e2b1f9142e95a to your computer and use it in GitHub Desktop.
Save rk295/1ade6cf3a069d072c05e2b1f9142e95a to your computer and use it in GitHub Desktop.
global
debug
# log 127.0.0.1 local6
# log 127.0.0.1 local2 info
# chroot /var/lib/haproxy
pidfile /var/run/haproxy.pid
maxconn 2000
# user haproxy
# group haproxy
daemon
# stats socket /var/lib/haproxy/stats
lua-load /usr/local/etc/haproxy/script.lua
defaults
mode tcp
log global
option dontlognull
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 2000
listen stats # Define a listen section called "stats"
bind :9000 # Listen on localhost:9000
mode http
stats enable # Enable stats page
stats hide-version # Hide HAProxy version
stats realm Haproxy\ Statistics # Title text for popup window
stats uri /haproxy_stats # Stats URI
stats auth Username:Password # Authentication credentials
frontend status-lua
bind *:8000
mode http
http-request use-service lua.status_service
# LDAP frontend
frontend ldap_front
bind *:1389
description LDAP Service
option socket-stats
option tcpka
timeout client 5s
default_backend simple-ad
# Simple AD backend
backend simple-ad
balance roundrobin
# TODO: replace with DNS entries
server directory1 10.102.115.63:8081 check port 8081
server directory2 10.102.115.63:8082 check port 8082
option tcp-check
# tcp-check connect port 8081
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment