feat(routing): next.config.ts redirects() 10개 추가
P1 IA 마이그레이션 — 기존 URL → 새 URL 영구 리다이렉트 (permanent: true): - /services/music → /music/packs - /services/music/samples → /music/samples - /studio → /music/studio - /freelance → /work/freelance - /services/website → /work/website - /services/website/samples/:slug → /work/website/samples/:slug - /services/blog → /work/blog - /saju → /work/saju - /saju/input → /work/saju/input - /saju/result → /work/saju/result 이 시점에 destination 페이지 아직 없음 (Phase B에서 생성). 단, redirect 자체는 빌드 OK. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -6,37 +6,46 @@ const nextConfig: NextConfig = {
|
|||||||
{
|
{
|
||||||
source: "/:path*",
|
source: "/:path*",
|
||||||
headers: [
|
headers: [
|
||||||
// 클릭재킹 방지
|
|
||||||
{ key: "X-Frame-Options", value: "DENY" },
|
{ key: "X-Frame-Options", value: "DENY" },
|
||||||
// MIME 스니핑 방지
|
|
||||||
{ key: "X-Content-Type-Options", value: "nosniff" },
|
{ key: "X-Content-Type-Options", value: "nosniff" },
|
||||||
// Referrer 정책
|
|
||||||
{ key: "Referrer-Policy", value: "strict-origin-when-cross-origin" },
|
{ key: "Referrer-Policy", value: "strict-origin-when-cross-origin" },
|
||||||
// XSS 필터 (레거시 브라우저)
|
|
||||||
{ key: "X-XSS-Protection", value: "1; mode=block" },
|
{ key: "X-XSS-Protection", value: "1; mode=block" },
|
||||||
// HTTPS 강제 (Vercel은 자동 HTTPS이므로 안전)
|
|
||||||
{
|
{
|
||||||
key: "Strict-Transport-Security",
|
key: "Strict-Transport-Security",
|
||||||
value: "max-age=63072000; includeSubDomains; preload",
|
value: "max-age=63072000; includeSubDomains; preload",
|
||||||
},
|
},
|
||||||
// 권한 정책
|
|
||||||
{
|
{
|
||||||
key: "Permissions-Policy",
|
key: "Permissions-Policy",
|
||||||
value: "camera=(), microphone=(), geolocation=()",
|
value: "camera=(), microphone=(), geolocation=()",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
// API 엔드포인트: 캐시 금지 + CORS 차단
|
|
||||||
{
|
{
|
||||||
source: "/api/:path*",
|
source: "/api/:path*",
|
||||||
headers: [
|
headers: [
|
||||||
{ key: "Cache-Control", value: "no-store, max-age=0" },
|
{ key: "Cache-Control", value: "no-store, max-age=0" },
|
||||||
// 동일 출처 요청만 허용 (외부 도메인 API 직접 호출 차단)
|
|
||||||
{ key: "X-Frame-Options", value: "DENY" },
|
{ key: "X-Frame-Options", value: "DENY" },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
},
|
},
|
||||||
|
async redirects() {
|
||||||
|
return [
|
||||||
|
// Music 사업부 마이그
|
||||||
|
{ source: '/services/music', destination: '/music/packs', permanent: true },
|
||||||
|
{ source: '/services/music/samples', destination: '/music/samples', permanent: true },
|
||||||
|
{ source: '/studio', destination: '/music/studio', permanent: true },
|
||||||
|
// Custom Build 사업부 마이그
|
||||||
|
{ source: '/freelance', destination: '/work/freelance', permanent: true },
|
||||||
|
{ source: '/services/website', destination: '/work/website', permanent: true },
|
||||||
|
{ source: '/services/website/samples/:slug', destination: '/work/website/samples/:slug', permanent: true },
|
||||||
|
{ source: '/services/blog', destination: '/work/blog', permanent: true },
|
||||||
|
// 사주 마이그 (단순 URL, 카탈로그 spec은 보류)
|
||||||
|
{ source: '/saju', destination: '/work/saju', permanent: true },
|
||||||
|
{ source: '/saju/input', destination: '/work/saju/input', permanent: true },
|
||||||
|
{ source: '/saju/result', destination: '/work/saju/result', permanent: true },
|
||||||
|
];
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export default nextConfig;
|
export default nextConfig;
|
||||||
|
|||||||
Reference in New Issue
Block a user