From b1e92b0e5268fac3870d3457d67d498cb8066df7 Mon Sep 17 00:00:00 2001 From: pyr0ball Date: Mon, 20 Apr 2026 20:26:31 -0700 Subject: [PATCH] feat(docker): add /peregrine/ base-path routing in nginx Adds location blocks for /peregrine/assets/ and /peregrine/ so the SPA works correctly when accessed via a Caddy prefix that does not strip the path (e.g. direct host access without reverse proxy stripping). --- docker/web/nginx.conf | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docker/web/nginx.conf b/docker/web/nginx.conf index 2107e1a..b577abc 100644 --- a/docker/web/nginx.conf +++ b/docker/web/nginx.conf @@ -22,6 +22,19 @@ server { add_header Cache-Control "public, immutable"; } + # Handle /peregrine/ base path — used when accessed directly (no Caddy prefix stripping). + # ^~ blocks regex location matches so assets at /peregrine/assets/... are served correctly. + location ^~ /peregrine/assets/ { + alias /usr/share/nginx/html/assets/; + expires 1y; + add_header Cache-Control "public, immutable"; + } + + location /peregrine/ { + alias /usr/share/nginx/html/; + try_files $uri $uri/ /index.html; + } + # SPA fallback — must come after API and assets location / { try_files $uri $uri/ /index.html;