https://github.com/daggerok/docker-haproxy-example
HA proxy example: rote traffic in docker by using haproxy
https://github.com/daggerok/docker-haproxy-example
docker haproxy haproxy-configuration haproxy-docker
Last synced: 22 days ago
JSON representation
HA proxy example: rote traffic in docker by using haproxy
- Host: GitHub
- URL: https://github.com/daggerok/docker-haproxy-example
- Owner: daggerok
- Created: 2019-01-28T00:26:46.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-01-28T01:40:03.000Z (over 7 years ago)
- Last Synced: 2025-01-10T00:45:44.528Z (over 1 year ago)
- Topics: docker, haproxy, haproxy-configuration, haproxy-docker
- Language: Java
- Homepage:
- Size: 60.5 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# haproxy
How to rote traffic in docker by using haproxy
## flow
```
/
/web1** +------+
+--------->| app1 |
+---------+ +----------+ | +------+
| Browser |<-->| HA proxy |<--+
+---------+ +----------+ | /web2** +------+
+--------->| app2 |
+------+
```
## build run and test
_build_
```bash
./mvnw -f app/pom.xml
```
_run_
```bash
docker-compose up --build --force-recreate --remove-orphans
```
_test_
```bash
http :80/web1-hostname
{
"hostname": "27f78c8df6da"
}
http :80/web2-hostname
{
"hostname": "01a9b26cbcd8"
}
http :80/hostn
{
"hostname": "27f78c8df6da"
}
```
_tear down_
```bash
docker-compose down -v
```