I am experimenting with LXD 3.0 containers in my host Ubuntu 18.04 server. I have HAproxy running in one LXD container. And I have my main app running in nodejs in another LXD container.
My confusion is where and how do I install Letsencrypt cert to secure (SSL) the nodejs app? Is the cert only installed in the host? In HAproxy? In the nodejs? Or all three?
BTW, I access the nodejs by browsing to a subdomain (ex: nodejs.mydomain.com) HAproxy directs to the nodejs app container running on a specific port 9001.
If all traffic is directed to your HAProxy container first, then distributed to other containers, it’s probably best to request and install a certificate inside your HAProxy instance.
But you can also make sure other containers will be able to read the file by sharing the software directory with other containers (and your host machine). (For example, if you are using certbot, you can share /etc/letsencrypt directory from your machine to all containers so every container will have access to certificates)