jwilder nginx docker reverse proxy with acme companion

toastie89 582c8b6460 initial v1.0 1 year ago
utils 5d2f8267f5 initial v1.0 1 year ago
.gitignore 5d2f8267f5 initial v1.0 1 year ago
README.md 5d2f8267f5 initial v1.0 1 year ago
docker-compose.yml 5d2f8267f5 initial v1.0 1 year ago

README.md

nginx-proxy stack

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

  2. jrcs/letsencrypt-nginx-proxy-companion obtains certificates from letsencrypt used by the revsers proxy.

Mailcow

  • 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:

     environment:
       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

Background

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.