import type { NextConfig } from "next"; const securityHeaders = [ { key: "Strict-Transport-Security", value: "max-age=31536000; includeSubDomains; preload" }, { key: "X-Content-Type-Options", value: "nosniff" }, { key: "X-Frame-Options", value: "DENY" }, { key: "Referrer-Policy", value: "strict-origin-when-cross-origin" }, { key: "Permissions-Policy", value: "geolocation=()" }, { key: "Cross-Origin-Opener-Policy", value: "same-origin" }, { key: "Cross-Origin-Resource-Policy", value: "same-site" }, ]; const nextConfig: NextConfig = { output: "standalone", poweredByHeader: false, experimental: { // TypeScript 5 provides the compiler API and avoids CLI output-capture issues // in restricted build environments. useTypeScriptCli: false, }, turbopack: { root: process.cwd(), }, images: { formats: ["image/avif", "image/webp"], }, async redirects() { return [ { source: "/die-gemeinde/ueber-uns", destination: "/gemeinde/ueber-goldebek", permanent: true }, { source: "/die-gemeinde/doerpshuus", destination: "/leben/doerpshuus", permanent: true }, { source: "/die-gemeinde/dorfchronik", destination: "/gemeinde/dorfchronik", permanent: true }, { source: "/die-gemeinde/kulturausschuss", destination: "/leben/kulturausschuss", permanent: true }, { source: "/gemeindevertretung", destination: "/politik/gemeindevertretung", permanent: true }, { source: "/vereine", destination: "/leben/vereine", permanent: true }, { source: "/ueber-uns", destination: "/gemeinde/ueber-goldebek", permanent: true }, { source: "/informationen", destination: "/service", permanent: true }, { source: "/kalender", destination: "/termine", permanent: true }, { source: "/fahrten/:path*", destination: "/aktuelles", permanent: true }, { source: "/bilder", destination: "/gemeinde/ueber-goldebek", permanent: true }, ]; }, async headers() { return [ { source: "/(.*)", headers: securityHeaders }, { source: "/downloads/:path*", headers: [ { key: "Cache-Control", value: "public, max-age=604800" }, { key: "X-Robots-Tag", value: "noindex, noarchive" }, { key: "X-Frame-Options", value: "SAMEORIGIN" }, ], }, { source: "/images/:path*", headers: [{ key: "Cache-Control", value: "public, max-age=2592000" }], }, { source: "/fonts/:path*", headers: [{ key: "Cache-Control", value: "public, max-age=2592000" }], }, ]; }, }; export default nextConfig;