jwilder nginx docker reverse proxy with acme companion

root b10fcd94ca added ./data/acme.sh/ 1 year ago
data b10fcd94ca added ./data/acme.sh/ 1 year ago
utils af072cea30 updated example 1 year ago
README.md 59a0dc8b92 updated link to acme-companion 1 year ago
docker-compose.yml 4b9e4cb4da updated to acme-companion 1 year ago


nginx-proxy stack

  1. nginx-proxy acts as reverse proxy. The nginx configs get automatically created based on environment variables.

  2. acme-companion obtains certificates from letsencrypt used by the revsers proxy.


  • Edit ./data/conf.d/mailcow_proxy.conf or delete it when not using mailcow
  • When missing, create a hardlink to the config living in the conf.d subfolder: ln ../mailcow_proxy.conf mailcow_proxy.conf

Get started

To use the service of this stack, add to the respective docker-compose.yml:

       VIRTUAL_HOST: www.example.com
       LETSENCRYPT_HOST: www.example.com 
       LETSENCRYPT_EMAIL: webmaster+web-www.letsencrypt.org@example.com

Basic Auth

echo "someusername:"echo "somepassword" openssl passwd -stdin> ./data/htpasswd/www.example.com to enable basic auth for a vhost or use the bash script in ./utils/setup_basic-auth.sh


Both containers listen on /var/run/docker.sock to see the environment variables of new containers coming up.

Notes and pitfalls

When changing domains while moving from development to production, perform a docker system prune prior to restarting the service.