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 <cursoragent@cursor.com>
This commit is contained in:
Ilya Mukhortov 2026-09-02 18:29:51 +10:00
parent c5c7e3753f
commit 423e7ad468
1 changed files with 7 additions and 0 deletions

View File

@ -11,6 +11,13 @@
file_server 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}* { handle /{$URL_PREFIX:api-address}* {
reverse_proxy 127.0.0.1:8001 reverse_proxy 127.0.0.1:8001
} }