Caddy proxies HTTPS requests to FastAPI as HTTP on localhost:8001. Without ProxyHeadersMiddleware, request.scheme stays "http" and url_for() generates http:// URLs, causing mixed content blocking. The middleware reads X-Forwarded-Proto from Caddy and sets the correct scheme so all generated URLs use https://. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
21 KiB
21 KiB