-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.mjs
92 lines (87 loc) · 2.18 KB
/
next.config.mjs
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
83
84
85
86
87
88
89
90
91
92
import { setupDevPlatform } from '@cloudflare/next-on-pages/next-dev'
const { NODE_ENV, CF_ACCOUNT_ID } = process.env
if (NODE_ENV === 'development' && CF_ACCOUNT_ID) {
await setupDevPlatform()
}
const cspHeader = `
default-src 'self';
connect-src 'self' https://a.cerberauth.com;
script-src 'self' 'unsafe-inline' https://a.cerberauth.com/js/plausible.outbound-links.tagged-events.js;
style-src 'self' 'unsafe-inline';
img-src 'self' https://nacho.cerberauth.com https://gravatar.com;
frame-src 'none';
font-src 'self';
object-src 'none';
base-uri 'self';
form-action 'self';
frame-ancestors 'none';
upgrade-insecure-requests;
`
/** @type {import('next').NextConfig} */
const nextConfig = {
images: {
domains: ['nacho.cerberauth.com'],
},
headers() {
if (NODE_ENV === 'development') {
return []
}
return [
{
source: '/:path*',
headers: [
{
key: 'X-XSS-Protection',
value: '1; mode=block',
},
{
key: 'Access-Control-Allow-Origin',
value: 'https://nacho.cerberauth.com',
},
{
key: 'Access-Control-Allow-Methods',
value: 'GET, POST, OPTIONS',
},
{
key: 'X-DNS-Prefetch-Control',
value: 'on',
},
{
key: 'Strict-Transport-Security',
value: 'max-age=63072000; includeSubDomains; preload'
},
{
key: 'X-Frame-Options',
value: 'DENY',
},
{
key: 'Permissions-Policy',
value: 'fullscreen=(self)',
},
{
key: 'X-Content-Type-Options',
value: 'nosniff',
},
{
key: 'Referrer-Policy',
value: 'same-origin',
},
{
key: 'Content-Security-Policy',
value: cspHeader.replace(/\n/g, ''),
},
],
},
]
},
async redirects() {
return [
{
source: '/client/:path*',
destination: '/clients/:path*',
permanent: true,
},
]
},
}
export default nextConfig