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).
This commit is contained in:
parent
d3dfd015bf
commit
b1e92b0e52
1 changed files with 13 additions and 0 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue