feat(traefik): Add DNS challenge for wildcard SSL certificates
HostRegexp patterns don't work with HTTP challenge because Traefik can't request certificates for dynamic subdomains. Switched to DNS challenge using DigitalOcean provider for *.smoothschedule.com wildcard. Requires DO_AUTH_TOKEN environment variable to be set. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -28,6 +28,17 @@ certificatesResolvers:
|
||||
httpChallenge:
|
||||
entryPoint: web
|
||||
|
||||
letsencrypt-dns:
|
||||
# DNS challenge for wildcard certificates (*.smoothschedule.com)
|
||||
acme:
|
||||
email: 'admin@smoothschedule.com'
|
||||
storage: /etc/traefik/acme/acme.json
|
||||
dnsChallenge:
|
||||
provider: digitalocean
|
||||
resolvers:
|
||||
- "1.1.1.1:53"
|
||||
- "8.8.8.8:53"
|
||||
|
||||
http:
|
||||
routers:
|
||||
# Main domain and www
|
||||
@@ -86,7 +97,7 @@ http:
|
||||
certResolver: letsencrypt
|
||||
|
||||
# Wildcard subdomain router for tenant subdomains
|
||||
# Each subdomain gets its own certificate via HTTP challenge
|
||||
# Uses DNS challenge for wildcard certificate (*.smoothschedule.com)
|
||||
# Routes to nginx which serves the frontend SPA and proxies /api/ to Django
|
||||
subdomain-router:
|
||||
rule: 'HostRegexp(`{subdomain:[a-z0-9-]+}.smoothschedule.com`)'
|
||||
@@ -96,7 +107,11 @@ http:
|
||||
- csrf
|
||||
service: nginx
|
||||
tls:
|
||||
certResolver: letsencrypt
|
||||
certResolver: letsencrypt-dns
|
||||
domains:
|
||||
- main: "smoothschedule.com"
|
||||
sans:
|
||||
- "*.smoothschedule.com"
|
||||
|
||||
flower-secure-router:
|
||||
rule: 'Host(`smoothschedule.com`)'
|
||||
|
||||
@@ -40,11 +40,13 @@ services:
|
||||
- django
|
||||
volumes:
|
||||
- production_traefik:/etc/traefik/acme
|
||||
environment:
|
||||
# DigitalOcean API token for DNS challenge (wildcard certs)
|
||||
- DO_AUTH_TOKEN=${DO_AUTH_TOKEN}
|
||||
ports:
|
||||
- '0.0.0.0:80:80'
|
||||
- '0.0.0.0:443:443'
|
||||
- '0.0.0.0:5555:5555'
|
||||
- '0.0.0.0:5555:5555'
|
||||
|
||||
nginx:
|
||||
build:
|
||||
|
||||
Reference in New Issue
Block a user