https://github.com/rgl/haproxy-active-passive-load-balancer-vagrant
a haproxy active-passive load balancer
https://github.com/rgl/haproxy-active-passive-load-balancer-vagrant
haproxy https
Last synced: 7 months ago
JSON representation
a haproxy active-passive load balancer
- Host: GitHub
- URL: https://github.com/rgl/haproxy-active-passive-load-balancer-vagrant
- Owner: rgl
- Created: 2018-12-16T17:42:55.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2023-08-01T18:11:26.000Z (over 2 years ago)
- Last Synced: 2025-03-31T07:22:41.159Z (10 months ago)
- Topics: haproxy, https
- Language: Shell
- Homepage:
- Size: 51.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
This is a haproxy active-passive load balancer.
Each node has the following components and connections:

# Usage
Build and install the [Ubuntu 22.04 Base Box](https://github.com/rgl/ubuntu-vagrant).
Add the following entries to your `/etc/hosts` file:
```
10.42.0.10 lb.example.com
10.42.0.11 app.example.com
```
Run `vagrant up --provider=libvirt` to launch everything.
Show the statistics from within the machine:
```bash
vagrant ssh lb
sudo su -l
echo 'show stat' | nc -U /run/haproxy/admin.sock
```
Or access the [statists web page](http://10.42.0.10:9000).
Access the application using HTTP:
```bash
fqdn="app.$(hostname --domain)"
curl \
--verbose \
--no-progress-meter \
--fail \
--output - \
http://$fqdn/try
```
Access the application using HTTPS:
```bash
fqdn="app.$(hostname --domain)"
crt_fqdn="$(hostname --fqdn)"
curl \
--verbose \
--no-progress-meter \
--fail \
--output - \
--cert "/vagrant/shared/example-ca/$crt_fqdn-client-crt.pem" \
--key "/vagrant/shared/example-ca/$crt_fqdn-client-key.pem" \
https://$fqdn/try
```
# Reference
* [Emulating Active/Passing Application Clustering with HAProxy](https://www.haproxy.com/blog/emulating-activepassing-application-clustering-with-haproxy/)
* [HAProxy Documentation](https://docs.haproxy.org)
* [HAProxy 2.4 Configuration Reference](https://docs.haproxy.org/2.4/configuration.html)
* [Proxy keywords matrix](https://docs.haproxy.org/2.4/configuration.html#4.1)
* [Server and default-server options](https://docs.haproxy.org/2.4/configuration.html#5.2)