Repository navigation
Expand file tree
/
Copy pathnext.config.ts
More file actions
49 lines (46 loc) · 1.68 KB
/
Copy pathnext.config.ts
File metadata and controls
49 lines (46 loc) · 1.68 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
import { withPayload } from '@payloadcms/next/withPayload'
import type { NextConfig } from 'next'
const onionHost = 'zq5xve7vxljrsccptc4wxmuebnuiglhylahfwahyw7dzlxc43em4w6yd.onion'
const nextConfig: NextConfig = {
output: 'standalone',
async headers() {
return [{
source: '/:path*',
headers: [
{ key: 'Strict-Transport-Security', value: 'max-age=31536000; includeSubdomains; preload' },
{ key: 'X-Frame-Options', value: 'SAMEORIGIN' },
{ key: 'X-Content-Type-Options', value: 'nosniff' },
{ key: 'Referrer-Policy', value: 'strict-origin' },
{
key: 'Content-Security-Policy',
value: [
"default-src 'self'",
"script-src 'self' 'unsafe-inline' https://matomo.daten.cool",
"style-src 'self' 'unsafe-inline'",
"img-src 'self' data: https://matomo.daten.cool",
"font-src 'self'",
"connect-src 'self' https://matomo.daten.cool",
"form-action 'self' https://listen.daten.cool",
"frame-ancestors 'self'",
].join('; '),
},
{ key: 'Onion-Location', value: `http://${onionHost}/:path*` },
],
}]
},
async rewrites() {
return [
{ source: '/:slug.txt', destination: '/text-export/:slug' },
]
},
async redirects() {
// /trends and /regional were merged into /analyse; query strings
// (q, term, remove, min_year, max_year) pass through unchanged and
// remain valid on the new page.
return [
{ source: '/trends', destination: '/analyse', permanent: true },
{ source: '/regional', destination: '/analyse', permanent: true },
]
},
}
export default withPayload(nextConfig)