/** @type {import('next').NextConfig} */ const apiInternalUrl = (process.env.API_INTERNAL_URL || "http://localhost:3000").replace(/\/$/, ""); const nextConfig = { allowedDevOrigins: [ "192.168.3.13", "docker01.int.jappel.io", "lb.jappel.io" ], typescript: { tsconfigPath: "./tsconfig.next.json", }, poweredByHeader: false, // Clickjacking: the Config pages hold admin actions, so no foreign page // may frame the app. Same-origin framing stays allowed. async headers() { return [ { source: "/:path*", headers: [ { key: "X-Frame-Options", value: "SAMEORIGIN" }, { key: "Content-Security-Policy", value: "frame-ancestors 'self'" }, { key: "X-Content-Type-Options", value: "nosniff" }, { key: "Referrer-Policy", value: "same-origin" }, ], }, ]; }, async rewrites() { return [ { source: "/api/:path*", destination: `${apiInternalUrl}/api/:path*`, }, { source: "/health", destination: `${apiInternalUrl}/health`, }, ]; }, }; export default nextConfig;