-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.js
More file actions
82 lines (78 loc) · 2.24 KB
/
next.config.js
File metadata and controls
82 lines (78 loc) · 2.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/** @type {import('next').NextConfig} */
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',
});
const ContentSecurityPolicy = `
default-src 'self';
script-src 'self' 'unsafe-inline' 'unsafe-eval' https://www.googletagmanager.com https://www.google-analytics.com https://utteranc.es https://giscus.app;
style-src 'self' 'unsafe-inline';
img-src 'self' data: blob: https:;
font-src 'self' https:;
connect-src 'self' https://www.google-analytics.com https://analytics.google.com https://www.googletagmanager.com https://api.github.com https://utteranc.es https://giscus.app;
frame-src https://utteranc.es https://giscus.app https://www.youtube.com https://www.youtu.be;
frame-ancestors 'none';
base-uri 'self';
form-action 'self';
`
.replace(/\n/g, ' ')
.trim();
const securityHeaders = [
{ key: 'Content-Security-Policy', value: ContentSecurityPolicy },
{ key: 'X-DNS-Prefetch-Control', value: 'on' },
{ key: 'X-Content-Type-Options', value: 'nosniff' },
{ key: 'X-Frame-Options', value: 'SAMEORIGIN' },
{ key: 'X-XSS-Protection', value: '1; mode=block' },
{ key: 'Referrer-Policy', value: 'strict-origin-when-cross-origin' },
{
key: 'Permissions-Policy',
value: 'camera=(), microphone=(), geolocation=()',
},
{
key: 'Strict-Transport-Security',
value: 'max-age=63072000; includeSubDomains; preload',
},
];
const nextConfig = {
images: {
remotePatterns: [
{
protocol: 'https',
hostname: 'idmlft3uczstcjaa.public.blob.vercel-storage.com',
pathname: '/images/**',
},
{
protocol: 'https',
hostname: '*',
},
],
}, // 빌드 시 RSS 피드를 생성하는 스크립트 실행
async headers() {
return [
{
source: '/(.*)',
headers: securityHeaders,
},
];
},
async rewrites() {
return [
{
source: '/rss.xml',
destination: '/api/rss',
},
{
source: '/atom.xml',
destination: '/api/rss',
},
{
source: '/feed.json',
destination: '/api/rss',
},
];
},
env: {
DB_URI: process.env.DB_URI,
},
reactStrictMode: false,
};
module.exports = withBundleAnalyzer(nextConfig);