How to host multiple web sites with NGINX and HAProxy using LXD on Ubuntu

Click for: original source

Simos Xenitellis wrote an article for digitalocean.com about hosting web application in LXD containers. For many Docker became de facto container solution of choice, but there are different Linux containers available. This article is about LXD which can create and manage these containers. LXD provides a hypervisor service to manage the entire life cycle of containers.

In this tutorial, you’ll use LXD to install two Nginx-based web sites on the same server, each confined to its own container. Then you’ll install HAProxy in a third container which will act as a reverse proxy. You’ll then route traffic to the HAProxy container in order to make both web sites accessible from the Internet.

Article describes how to:

  • Configure Linux users and LXD
  • Configure and use block storage
  • Configure networking
  • How to create containers
  • How to configure NGINX containers
  • Configuring the HAProxy container

And much more. Plenty of code examples will guide you through whole process. Well worth reading!

[Read More]

Tags containers nginx docker