- Apache2 설치·모듈·HTTPS(certbot webroot)·vhost 자동 구성 - HTTP 전용 부트스트랩/테스트 설정 추가 - 기존 nginx 인증서 갱신 방식을 webroot로 자동 전환 - 짧은 주소 리다이렉트를 next.config.ts로 이동해 웹서버 공통화
58 lines
1.9 KiB
TypeScript
58 lines
1.9 KiB
TypeScript
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;
|