fix(traefik): Add host rewriting for email autoconfig endpoints
Django's multi-tenant middleware doesn't recognize autoconfig/autodiscover subdomains. This middleware rewrites the Host header to api.smoothschedule.com so Django routes the request to the public schema. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -64,10 +64,13 @@ http:
|
||||
certResolver: letsencrypt
|
||||
|
||||
# Email autoconfiguration subdomains
|
||||
# These need host rewriting because Django's tenant middleware doesn't recognize them
|
||||
autoconfig-router:
|
||||
rule: 'Host(`autoconfig.smoothschedule.com`)'
|
||||
entryPoints:
|
||||
- web-secure
|
||||
middlewares:
|
||||
- email-autoconfig-host
|
||||
service: django
|
||||
tls:
|
||||
certResolver: letsencrypt
|
||||
@@ -76,6 +79,8 @@ http:
|
||||
rule: 'Host(`autodiscover.smoothschedule.com`)'
|
||||
entryPoints:
|
||||
- web-secure
|
||||
middlewares:
|
||||
- email-autoconfig-host
|
||||
service: django
|
||||
tls:
|
||||
certResolver: letsencrypt
|
||||
@@ -107,6 +112,12 @@ http:
|
||||
headers:
|
||||
hostsProxyHeaders: ['X-CSRFToken']
|
||||
|
||||
email-autoconfig-host:
|
||||
# Rewrite Host header so Django tenant middleware routes to API/public schema
|
||||
headers:
|
||||
customRequestHeaders:
|
||||
Host: 'api.smoothschedule.com'
|
||||
|
||||
services:
|
||||
django:
|
||||
loadBalancer:
|
||||
|
||||
Reference in New Issue
Block a user