Repository navigation
Expand file tree
/
Copy pathnext.config.ts
More file actions
52 lines (49 loc) · 1.76 KB
/
Copy pathnext.config.ts
File metadata and controls
52 lines (49 loc) · 1.76 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
import type { NextConfig } from 'next';
const nextConfig: NextConfig = {
experimental: {
// Limit concurrent page generation to avoid API rate limits
staticGenerationMaxConcurrency: 3,
},
async headers() {
return [
{
source: '/:path*',
headers: [
{
key: 'X-Content-Type-Options',
value: 'nosniff',
},
{
key: 'X-Frame-Options',
value: 'DENY',
},
{
key: 'Referrer-Policy',
value: 'strict-origin-when-cross-origin',
},
{
key: 'Permissions-Policy',
value: 'geolocation=(self), microphone=(), camera=()',
},
{
key: 'Content-Security-Policy',
value: [
"default-src 'self'",
// unsafe-inline: required by Next.js (hydration, JSON-LD) and Mapbox GL JS (inline styles)
"script-src 'self' 'unsafe-inline' https://api.mapbox.com https://vercel.live",
"style-src 'self' 'unsafe-inline' https://api.mapbox.com https://vercel.live",
"img-src 'self' data: blob: https://api.mapbox.com https://tiles.mapbox.com https://vercel.live https://vercel.com",
"font-src 'self' https://vercel.live https://assets.vercel.com",
"connect-src 'self' https://api.citybik.es https://api.mapbox.com https://tiles.mapbox.com https://events.mapbox.com https://vercel.live wss://ws-us3.pusher.com",
"worker-src 'self' blob: https://api.mapbox.com",
"frame-src 'self' https://vercel.live",
"base-uri 'self'",
"form-action 'self'",
].join('; '),
},
],
},
];
},
};
export default nextConfig;