Annixa / docker-nginx-letsencrypt-proxy

Docker Nginx Proxy with Let's Encrypt simplifies application proxying with Let's Encrypt.
MIT License
16 stars 11 forks source link

Docker Nginx Proxy with Let's Encrypt

GitHub Release Version Docker Hub Pulls Docker Hub Stars GitHub Open Issues

Docker Nginx Proxy with Let's Encrypt simplifies application integration with Let's Encrypt.

This project provides a simple nginx configuration and auto-updating Let's Encrypt for integration with existing services.

Docker Hub image: docker-nginx-letsencrypt-proxy

Quick Deploy (docker-compose.yml)

"Put this in your stack and deploy it."

version: '2'
docker-nginx-letsencrypt-proxy:
build: .
ports:
- 80:80
- 443:443
container_name: docker-nginx-letsencrypt-proxy
log_opt:
max-size: 50k
environment:
- LE_ENABLED=true
# - LE_TEST=true # LE is rate limited. While doing development, be sure to set testing mode so requests don't count against our quota.
- LE_EMAIL=test@test.com # Your email, here
- LE_DOMAIN=domain.com #A comma separated list of your domains, here
- PROXY_DEST=https://www.google.com #A comma separated list of destinations for the proxied services
# - PROXY_PORT=8443
# - SLACK_NOTIFICATIONS_INFRA_URL=https://hooks.slack.com/services/???????? # Be sure to fill this in using your URL for the slack webhook integration
volumes:
- "/etc/letsencrypt"
# links:
#   - mycontainer
# If using version 1, link to your container

Configuration

The following docker environment variables are required for proper usage:

Configuration Oldest compatible client
MODERN Firefox 27, Chrome 30, IE 11 on Windows 7, Edge, Opera 17, Safari 9, Android 5.0, Java 8
INTERMEDIATE Firefox 1, Chrome 1, IE 7, Opera 5, Safari 1, Windows XP IE8, Android 2.3, Java 7
OLD Windows XP IE6, Java 6

How It Works

When certificates are updated, the event handler will:

  1. Move the resulting certificates to /etc/nginx/ssl
  2. Tell supervisor to restart nginx: supervisorctl restart nginx
  3. If SLACK_NOTIFICATIONS_INFRA_URL is set, send a notification to your slack channel.

The premise is simple: