mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-05-13 17:46:02 +00:00
fix(frontend): anchor Vite dev proxy so /login.html isn't forwarded
The /login proxy entry was matching any path starting with /login — including /login.html, which Vite is supposed to serve itself. Without the Go backend running, this caused ECONNREFUSED noise on every page load. Switched to regex patterns anchored with ^...$ so only the bare backend paths (/login, /logout, /getTwoFactorEnable) and explicit sub-routes (/panel/*, /server/*) get proxied. Static .html files Vite serves directly are no longer matched. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
parent
ebe57ef273
commit
1faecbe1dd
1 changed files with 5 additions and 4 deletions
|
|
@ -32,10 +32,11 @@ export default defineConfig({
|
||||||
strictPort: true,
|
strictPort: true,
|
||||||
proxy: {
|
proxy: {
|
||||||
// Proxy API calls during `npm run dev` to the local Go panel.
|
// Proxy API calls during `npm run dev` to the local Go panel.
|
||||||
'/panel': 'http://localhost:2053',
|
// Patterns are anchored regex so /login.html and /index.html
|
||||||
'/server': 'http://localhost:2053',
|
// (which Vite serves itself) are NOT forwarded — only the bare
|
||||||
'/login': 'http://localhost:2053',
|
// backend paths and their sub-routes.
|
||||||
'/logout': 'http://localhost:2053',
|
'^/(login|logout|getTwoFactorEnable)$': 'http://localhost:2053',
|
||||||
|
'^/(panel|server)(/|$)': 'http://localhost:2053',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue