From c7b9ab18bb44fd81a97c4017b0a8130e83a92052 Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 25 Jul 2025 11:12:27 -0600 Subject: [PATCH] Fix static asset routing and path handling for auth/accounts/cast apps - Fixed Next.js static asset (_next/*) routing for each app separately - Updated app path handling to work with both /app and /app/* patterns - Resolved 404 errors for static assets from auth, accounts, and cast apps - Updated to version 0.1.66 --- CloudronManifest.json | 2 +- start.sh | 40 ++++++++++++++++++++++++++++++++-------- 2 files changed, 33 insertions(+), 9 deletions(-) diff --git a/CloudronManifest.json b/CloudronManifest.json index 3fef77d..851f017 100644 --- a/CloudronManifest.json +++ b/CloudronManifest.json @@ -7,7 +7,7 @@ "contactEmail": "contact@ente.io", "tagline": "Open Source End-to-End Encrypted Photos & Authentication", "upstreamVersion": "1.0.0", - "version": "0.1.64", + "version": "0.1.66", "healthCheckPath": "/ping", "httpPort": 3080, "memoryLimit": 1073741824, diff --git a/start.sh b/start.sh index f614eb1..37aa143 100644 --- a/start.sh +++ b/start.sh @@ -702,14 +702,38 @@ cat > "$CADDY_CONFIG" << EOF reverse_proxy localhost:8080 } - # Static files for Next.js assets from all apps - handle /_next/* { + # Static files for Next.js assets - handle per app + handle_path /photos/_next/* { root * /app/web/photos file_server header { Cache-Control "public, max-age=31536000" } } + + handle_path /accounts/_next/* { + root * /app/web/accounts + file_server + header { + Cache-Control "public, max-age=31536000" + } + } + + handle_path /auth/_next/* { + root * /app/web/auth + file_server + header { + Cache-Control "public, max-age=31536000" + } + } + + handle_path /cast/_next/* { + root * /app/web/cast + file_server + header { + Cache-Control "public, max-age=31536000" + } + } # Static images and assets (served from photos app by default) handle /images/* { @@ -735,22 +759,22 @@ cat > "$CADDY_CONFIG" << EOF file_server } - # Accounts app - handle_path /accounts/* { + # Accounts app - handle both /accounts and /accounts/* + handle /accounts* { root * /app/web/accounts try_files {path} /index.html file_server } - # Auth app - handle_path /auth/* { + # Auth app - handle both /auth and /auth/* + handle /auth* { root * /app/web/auth try_files {path} /index.html file_server } - # Cast app - handle_path /cast/* { + # Cast app - handle both /cast and /cast/* + handle /cast* { root * /app/web/cast try_files {path} /index.html file_server