-
-
Save aug2uag/bcf8061ea82c20b2ac8be8999234efbd to your computer and use it in GitHub Desktop.
Setting up HAProxy on Mac OSX
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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