import type { NextConfig } from "next"; // 다층 캐시·SEO 차단(§4)의 응답 헤더 계층. immutable 정적 자산(_next/static, _next/image)은 // Next.js가 자체적으로 Cache-Control을 강제하므로 대상에서 제외해 자산 캐싱을 보존한다. const SECURITY_HEADERS = [ { key: "X-Robots-Tag", value: "noindex, nofollow, noarchive, nosnippet, noimageindex", }, { key: "Cache-Control", value: "no-store, no-cache, must-revalidate" }, { key: "Pragma", value: "no-cache" }, { 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: "camera=(), microphone=(), geolocation=()", }, ]; const nextConfig: NextConfig = { async headers() { return [ { source: "/((?!_next/static|_next/image).*)", headers: SECURITY_HEADERS, }, ]; }, }; export default nextConfig;