-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnext.config.js
55 lines (49 loc) · 1.38 KB
/
next.config.js
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
/** @type {import('next').NextConfig} */
const allowedIframeEmbeddingUrls = process.env.NEXT_PUBLIC_IFRAME_ALLOWED_ORIGINS?.split(',')?.join(' ') || ''
const nextConfig = {
reactStrictMode: true,
webpack(config) {
config.resolve.fallback = {
...config.resolve.fallback, // if you miss it, all the other options in fallback, specified
// by next.js will be dropped. Doesn't make much sense, but how it is
fs: false, // the solution
}
return config
},
headers: () => {
return [
{
source: '/:path*',
headers: [
{
key: 'X-Frame-Options',
value: 'SAMEORIGIN',
},
{
key: 'Content-Security-Policy',
value: "frame-ancestors 'self';",
},
{
key: 'Strict-Transport-Security',
value: 'max-age=63072000; includeSubDomains; preload',
},
],
},
{
source: '/iframe/:path*',
headers: [
{
key: 'Content-Security-Policy',
value: `frame-ancestors self ${allowedIframeEmbeddingUrls};`,
},
{
key: 'Permissions-Policy',
value:
'payment=*, publickey-credentials-get=*, publickey-credentials-create=*, clipboard-read=*, clipboard-write=*',
},
],
},
]
},
}
module.exports = nextConfig