Route same-origin API via /apnew/api to bypass ALB /api* rule.
All checks were successful
Deploy to Frontend Servers / deploy (push) Successful in 53s

ALB sends /api/* to an unreachable backend target group (502 on apex).
Use VITE_API_PREFIX=/apnew with nginx proxy to backend-1 until the listener rule is removed.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-05-23 17:56:38 +08:00
parent 2c710e2e24
commit 769087ba4a
5 changed files with 28 additions and 2 deletions

View File

@@ -20,6 +20,11 @@ export default defineConfig(({ mode }) => {
server: {
port: 5173,
proxy: {
"/apnew/api": {
target: apiProxyTarget,
changeOrigin: true,
rewrite: (path) => path.replace(/^\/apnew/, ""),
},
"/api": { target: apiProxyTarget, changeOrigin: true },
"/uploads": { target: apiProxyTarget, changeOrigin: true },
},