import type { NextConfig } from "next"; const nextConfig: NextConfig = { async rewrites() { return [ { source: "/api/:path*", // Server-side proxy for direct :3000 access. Uses the internal service // hostname inside Docker (API_INTERNAL_URL=http://backend:8000); falls // back to localhost for non-container dev. Not used when served via // nginx, which proxies /api itself. destination: `${process.env.API_INTERNAL_URL || "http://localhost:8000"}/api/:path*`, }, ]; }, }; export default nextConfig;