From b9224464c08098cd33ce35e7d70be6ca5ae188fa Mon Sep 17 00:00:00 2001 From: Chenlei Hu Date: Wed, 13 Nov 2024 15:36:35 -0500 Subject: [PATCH] Fix reverse proxy (#1532) --- src/router.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/router.ts b/src/router.ts index 52868c4ab..9fb37c080 100644 --- a/src/router.ts +++ b/src/router.ts @@ -22,7 +22,12 @@ const guardElectronAccess = ( } const router = createRouter({ - history: isFileProtocol() ? createWebHashHistory() : createWebHistory(), + history: isFileProtocol() + ? createWebHashHistory() + : // Base path must be specified to ensure correct relative paths + // Example: For URL 'http://localhost:7801/ComfyBackendDirect', + // we need this base path or assets will incorrectly resolve from 'http://localhost:7801/' + createWebHistory(window.location.pathname), routes: [ { path: '/',