-
-
Notifications
You must be signed in to change notification settings - Fork 12
/
next.config.js
73 lines (72 loc) · 1.89 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
const ALT_LANGUAGES = require("./ydr-config.json").altLanguages;
const LOCALES = Array(...Object.keys(ALT_LANGUAGES), "az");
module.exports = {
async redirects() {
return [
{
source: '/',
has: [
{
type: 'query',
key: 'company',
value: '(?<company>.*)',
},
],
destination: '/d/:company',
permanent: true,
},
{
source: '/data-brokers',
destination: 'https://databrokerswatch.org/top-ten',
permanent: false,
},
]
},
async rewrites() {
return [
{
source: "/save",
destination: "/api/save",
},
{
source: "/companies",
destination: "/api/companies",
},
{
source: '/sitemaps.xml',
destination: '/dynamic-sitemaps',
},
{
source: '/sitemaps-:page.xml',
destination: '/dynamic-sitemaps/:page',
},
];
},
i18n: {
// These are all the locales you want to support in
// your application
locales: LOCALES,
defaultLocale: "en",
},
images: {
domains: ['logo.uplead.com'],
},
async headers() {
return [
{
// Apply these headers to all routes in your application.
source: '/(.*)',
headers: [
{
key: 'Referrer-Policy',
value: 'same-origin'
},
{
key: 'Content-Security-Policy',
value: "upgrade-insecure-requests ; default-src * 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval' *.innocraft.cloud js.stripe.com substackapi.com *.cloudflareinsights.com *.vercel-scripts.com; font-src 'self' fonts.gstatic.com fonts.googleapis.com; img-src 'self' data: logo.uplead.com; frame-src js.stripe.com"
},
],
},
]
},
};