From 423e7ad46814f08655d156d299dcfcc60a99b33e Mon Sep 17 00:00:00 2001 From: Ilya Mukhortov Date: Wed, 2 Sep 2026 18:29:51 +1000 Subject: [PATCH] Serve the SPA at /api-address/ from Caddy. Exact prefix paths return index.html; other /api-address* routes still proxy to Django. Co-authored-by: Cursor --- Caddyfile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Caddyfile b/Caddyfile index bfa3552..41565a8 100644 --- a/Caddyfile +++ b/Caddyfile @@ -11,6 +11,13 @@ file_server } + @spa path /{$URL_PREFIX:api-address} /{$URL_PREFIX:api-address}/ + handle @spa { + root * /app/client + rewrite * /index.html + file_server + } + handle /{$URL_PREFIX:api-address}* { reverse_proxy 127.0.0.1:8001 }