import type { NextConfig } from "next"; const nextConfig: NextConfig = { output: "standalone", poweredByHeader: false, compress: true, // 업로드 경로를 런타임에 결정하다 보니 Turbopack이 프로젝트 전체를 추적합니다. // 실제 실행에 필요 없는 소스/문서/개발 데이터는 standalone 결과에서 제외합니다. outputFileTracingExcludes: { "/*": [ "./docs/**/*", "./src/**/*", "./scripts/**/*", "./storage/**/*", "./prisma/dev.db", "./README.md", "./AGENTS.md", "./.env", "./.env.*", "./Dockerfile", "./docker-compose.yml", // Node.js 런타임에서는 바이너리 엔진을 사용하므로 Edge용 wasm 사본은 불필요합니다. "./node_modules/@prisma/client/runtime/*.wasm-base64.js", "./node_modules/@prisma/client/runtime/*.wasm-base64.mjs", ], }, experimental: { serverActions: { // 첨부파일 업로드(최대 10개 × 50MB)를 고려한 값입니다. bodySizeLimit: "60mb", }, }, async redirects() { // nginx/Apache 어느 쪽을 쓰더라도 동일하게 동작하도록 Next.js에서 처리합니다. return [ { source: "/index.html", destination: "/", permanent: true }, { source: "/index.htm", destination: "/", permanent: true }, { source: "/news", destination: "/news/notice", permanent: true }, { source: "/board", destination: "/news/notice", permanent: true }, ]; }, async headers() { return [ { source: "/:path*", headers: [ { key: "X-Content-Type-Options", value: "nosniff" }, { key: "X-Frame-Options", value: "SAMEORIGIN" }, { key: "Referrer-Policy", value: "strict-origin-when-cross-origin" }, { key: "Permissions-Policy", value: "geolocation=(), microphone=(), camera=()" }, ], }, ]; }, }; export default nextConfig;