import type { NextConfig } from "next"; const nextConfig: NextConfig = { experimental: { externalDir: true, }, async rewrites() { return { beforeFiles: [ { source: "/api/:path*", destination: "http://backend:8080/api/:path*", }, ], }; }, headers: async () => { return [ { source: "/api/:path*", headers: [ { key: "X-Forwarded-For", value: "127.0.0.1", }, ], }, ]; }, }; export default nextConfig;