Skip to content

HA proxy example: rote traffic in docker by using haproxy

Notifications You must be signed in to change notification settings

daggerok/docker-haproxy-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

haproxy

How to rote traffic in docker by using haproxy

flow

                                 /
                                 /web1**  +------+
                               +--------->| app1 |
 +---------+    +----------+   |          +------+
 | Browser |<-->| HA proxy |<--+
 +---------+    +----------+   | /web2**  +------+
                               +--------->| app2 |
                                          +------+

build run and test

build

./mvnw -f app/pom.xml

run

docker-compose up --build --force-recreate --remove-orphans

test

http :80/web1-hostname
{
    "hostname": "27f78c8df6da"
}

http :80/web2-hostname
{
    "hostname": "01a9b26cbcd8"
}

http :80/hostn
{
    "hostname": "27f78c8df6da"
}

tear down

docker-compose down -v

About

HA proxy example: rote traffic in docker by using haproxy

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published