Skip to content

Instantly share code, notes, and snippets.

@davemckeown
Forked from dhavaln/Setup & Install
Created November 20, 2018 21:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davemckeown/63b3c93be494e77079913688896af2a8 to your computer and use it in GitHub Desktop.
Save davemckeown/63b3c93be494e77079913688896af2a8 to your computer and use it in GitHub Desktop.
Setting up HAProxy on Mac OSX
global
log 127.0.0.1 local0
log 127.0.0.1 local1 debug
#log loghost local0 info
maxconn 4096
#chroot /usr/share/haproxy
#daemon
#debug
#quiet
defaults
log global
mode http
option httplog
option dontlognull
retries 3
option redispatch
maxconn 2000
timeout connect 5000
timeout client 50000
timeout server 50000
frontend localnodes
bind *:8000
mode http
default_backend nodes
backend nodes
mode http
balance roundrobin
option forwardfor
http-request set-header X-Forwarded-Port %[dst_port]
http-request add-header X-Forwarded-Proto https if { ssl_fc }
option httpchk HEAD / HTTP/1.1\r\nHost:localhost
server server1 192.168.1.135:3000 check
Install HAProxy from Homebre:
`brew install haproxy`
For full reference:
https://serversforhackers.com/load-balancing-with-haproxy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment