-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.ts
77 lines (74 loc) · 2.99 KB
/
next.config.ts
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
import type {NextConfig} from 'next';
// https://nextjs.org/docs/advanced-features/security-headers
const securityHeaders = [
{key: 'Strict-Transport-Security', value: 'max-age=63072000; includeSubDomains; preload'},
{key: 'X-Content-Type-Options', value: 'nosniff'},
{key: 'X-Frame-Options', value: 'DENY'},
{key: 'X-XSS-Protection', value: '1; mode=block'},
{
key: 'Content-Security-Policy',
value: "default-src 'self'; img-src 'self' data: https://images.ctfassets.net; script-src 'self' 'unsafe-eval' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; font-src 'self' data:; connect-src 'self' https://vitals.vercel-insights.com; frame-ancestors https://app.contentful.com"
}
];
const nextConfig: NextConfig = {
async headers() {
return [
{
source: '/:path*',
headers: securityHeaders
}
];
},
async rewrites() {
return {
beforeFiles: [
{
source: '/images/photos/:path*',
destination: 'https://images.ctfassets.net/:path*'
},
{source: '/', destination: '/home'}
],
afterFiles: [],
fallback: []
};
},
async redirects() {
return [
{source: '/about-town', destination: '/london-street-photography', permanent: true},
{source: '/adnams-signifier', destination: '/adnams', permanent: true},
{source: '/adnams', destination: '/adnams-brewery-southwold', permanent: true},
{
source: '/fish-and-chips/:slug*',
destination: '/london-street-photography/fish-and-chips',
permanent: true
},
{source: '/gbh-b-roll', destination: '/good-beer-hunting-b-roll', permanent: true},
{
source: '/hukins-hops',
destination: '/hukins-hops-annual-hop-harvest',
permanent: true
},
{source: '/iceland', destination: '/iceland-on-film', permanent: true},
{source: '/india', destination: '/travelling-across-india', permanent: true},
{source: '/jw-lees-unrated', destination: '/jw-lees', permanent: true},
{source: '/jw-lees', destination: '/jw-lees-harvest-ale', permanent: true},
{source: '/tynt-meadow', destination: '/tynt-meadow-trappist-ale', permanent: true},
{
source: '/uppers-and-downers',
destination: '/uppers-and-downers-coffee-and-beer-festival',
permanent: true
}
];
},
experimental: {reactCompiler: true},
images: {
formats: ['image/webp'],
minimumCacheTTL: 31536000, // 1 year
remotePatterns: [
{protocol: 'https', hostname: 'images.ctfassets.net'},
{protocol: 'https', hostname: 'downloads.ctfassets.net'}
]
},
reactStrictMode: true
};
export default nextConfig;