To add basic auth to any of the sites you’ll need to make a file with the
VIRTUAL_HOST of the site, available to nginx in
/etc/nginx/htpasswd. For example, I added a file in
/mnt/user/docker/nginx/htpasswd/. You can create htpasswd files using
apache2-utils, or there are sites available which can create them.
From the Apps page again, search for
letsencrypt-nginx-proxy-companion, click ‘get more results from Docker Hub’, and then click ‘add’ under the listing for
letsencrypt-nginx-proxy-companion by jrcs. Enter the following container settings, again changing your ‘host path’ to wherever you store Docker configuration files on your unRAID host
In order to configure nginx, you’ll need to add four environment variables to the Docker containers you wish to put behind the reverse proxy. They are
LETSENCRYPT_HOST most likely need to be the same, and will be something like
VIRTUAL_PORT should be the port your Docker container exposes. For example, Sonarr uses port 8989 by default.
LETSENCRYPT_EMAIL should be a valid email address that Let’s Encrypt can use to email you about certificate expiries, etc.
letsencrypt-nginx-proxy-companion, and all your Docker containers are configured you should be able to access them all over SSL, with basic auth, from outside your LAN. You don’t even have to worry about certificate renewals as it’s all handled for you.