import type { NextConfig } from "next"; const subDomain = process.env.NEXT_PUBLIC_SUB_DOMAIN || "http://localhost:13000"; const backendUrl = process.env.NEXT_PUBLIC_SERVER_API_URL || "http://192.168.0.102:8000"; const nextConfig: NextConfig = { output: "standalone", async rewrites() { return { beforeFiles: [ { source: "/_next/static/:path*", destination: `${subDomain}/_next/static/:path*`, has: [ { type: "header", key: "referer", value: "(.*)/cms(.*)", }, ], }, ], afterFiles: [ { source: "/cms/:path*", destination: `${subDomain}/cms/:path*`, }, { source: "/user-service/:path*", destination: `${backendUrl}/user-service/:path*`, }, ], fallback: [], }; }, }; export default nextConfig;