We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Application Servers

First, we need to start some application servers so that our load balancer has somewhere to send the traffic! We'll use Caddy, an awesome open-source load balancer and web server. Nginx and Apache are other popular alternatives that do similar things, but Caddy is a modern version written in Go, so it'll be fun to use.

What Will Our Servers Do?

Each application server will serve a slightly different HTML webpage. We'll make them different so that we can see load balancing in action!

Assignment

docker pull caddy
<html>
  <body>
    <h1>Hello from server 1</h1>
  </body>
</html>
<html>
  <body>
    <h1>Hello from server 2</h1>
  </body>
</html>
docker run -d -p 8881:80 -v $PWD/index1.html:/usr/share/caddy/index.html caddy
docker run -d -p 8882:80 -v $PWD/index2.html:/usr/share/caddy/index.html caddy

Run and submit the CLI tests.