chore(proxy): expose backend under /admin139 on frontend port

这个提交包含在:
anygen-build-bot
2026-02-12 10:40:23 +00:00
父节点 21a5c0f269
当前提交 d33deed4c5
修改 4 个文件,包含 14 行新增12 行删除

查看文件

@@ -4,15 +4,15 @@ const nextConfig: NextConfig = {
// For local dev convenience. In production you should configure reverse proxy
// and set NEXT_PUBLIC_API_BASE to your public API origin.
async rewrites() {
// If the user sets NEXT_PUBLIC_API_BASE to "/api", we can proxy to backend
// from the Next.js server (SSR). This does NOT affect browser fetch.
// Reverse proxy backend under a path prefix, so browser can access backend
// with same-origin (no CORS): http://<host>:7888/admin139/...
const backendInternal = process.env.BACKEND_INTERNAL_URL;
if (!backendInternal) return [];
return [
{
source: "/api/:path*",
destination: `${backendInternal}/api/:path*`,
source: "/admin139/:path*",
destination: `${backendInternal}/:path*`,
},
];
},