From 1dd265b46d75183a52c649c5fadcf5744e9c779e Mon Sep 17 00:00:00 2001 From: jtricerolph Date: Wed, 1 Jul 2026 15:47:55 +0000 Subject: [PATCH] PWA: restrict navigateFallback to portal routes only MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The service worker was intercepting iframe navigation to app paths (/notices/, /kitchen/ etc.) and serving the portal's cached index.html before the request reached nginx — causing the 🚧 EmbeddedFallback. Only apply the fallback to portal routes; everything else goes to network. Co-Authored-By: Claude Opus 4.8 (1M context) --- vite.config.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/vite.config.ts b/vite.config.ts index 6124172..b66256e 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -22,6 +22,10 @@ export default defineConfig({ }, workbox: { navigateFallback: '/index.html', + // Only apply the navigation fallback to the portal's own routes. + // App sub-paths (/notices/, /kitchen/, etc.) must reach nginx so + // the portal nginx can proxy them to the correct app container. + navigateFallbackAllowlist: [/^\/($|login|app\/|admin\/)/], globPatterns: ['**/*.{js,css,html,ico,png,svg}'], }, }),