-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Install your load balancer
- Loading branch information
Showing
1 changed file
with
20 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/usr/bin/env bash | ||
# Install and configure HAproxy on your lb-01 server. | ||
|
||
ufw allow 1344 | ||
sudo apt-get -y update | ||
sudo apt-get install -y haproxy | ||
|
||
print %s " | ||
frontend proxynode | ||
bind *:80 | ||
mode http | ||
default_backend web-backend | ||
backend web-backend | ||
balance roundrobin | ||
option forwadfor | ||
server 338390-web-01 54.88.12.218:80 check | ||
server 338390-web-02 100.25.222.24:80 check | ||
" >> /etc/haproxy/haproxy.cfg | ||
|
||
sudo service haproxy restart |