mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-05-13 09:36:05 +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,
|
||||
proxy: {
|
||||
// Proxy API calls during `npm run dev` to the local Go panel.
|
||||
'/panel': 'http://localhost:2053',
|
||||
'/server': 'http://localhost:2053',
|
||||
'/login': 'http://localhost:2053',
|
||||
'/logout': 'http://localhost:2053',
|
||||
// Patterns are anchored regex so /login.html and /index.html
|
||||
// (which Vite serves itself) are NOT forwarded — only the bare
|
||||
// backend paths and their sub-routes.
|
||||
'^/(login|logout|getTwoFactorEnable)$': 'http://localhost:2053',
|
||||
'^/(panel|server)(/|$)': 'http://localhost:2053',
|
||||
},
|
||||
},
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue