-
Notifications
You must be signed in to change notification settings - Fork 39
Expand file tree
/
Copy pathnext.config.js
More file actions
160 lines (157 loc) · 6.31 KB
/
Copy pathnext.config.js
File metadata and controls
160 lines (157 loc) · 6.31 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
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
const { withContentCollections } = require("@content-collections/next");
const cspHeader = `
default-src 'self';
script-src 'self' 'unsafe-eval' 'unsafe-inline' https://app.intercom.io https://widget.intercom.io https://js.intercomcdn.com https://www.googletagmanager.com https://*.google-analytics.com https://*.analytics.google.com https://*.googletagmanager.com https://cdn.segment.com;
style-src 'self' 'unsafe-inline';
img-src 'self' blob: data: https://cdn.contentport.io https://cdn.bydefault.so https://js.intercomcdn.com https://static.intercomassets.com https://downloads.intercomcdn.com https://downloads.intercomcdn.eu https://downloads.au.intercomcdn.com https://uploads.intercomusercontent.com https://gifs.intercomcdn.com https://video-messages.intercomcdn.com https://messenger-apps.intercom.io https://messenger-apps.eu.intercom.io https://messenger-apps.au.intercom.io https://*.intercom-attachments.com https://static.intercomassets.eu https://static.au.intercomassets.com https://www.google-analytics.com https://www.googletagmanager.com https://*.google.com https://*.doubleclick.net https://www.google.com.tr;
font-src 'self' https://js.intercomcdn.com https://fonts.intercomcdn.com;
connect-src 'self' https://api-iam.intercom.io https://api-iam.eu.intercom.io https://api-iam.au.intercom.io https://api-ping.intercom.io https://nexus-websocket-a.intercom.io wss://nexus-websocket-a.intercom.io https://nexus-websocket-b.intercom.io wss://nexus-websocket-b.intercom.io https://nexus-europe-websocket.intercom.io wss://nexus-europe-websocket.intercom.io https://nexus-australia-websocket.intercom.io wss://nexus-australia-websocket.intercom.io https://uploads.intercomcdn.com https://uploads.intercomcdn.eu https://uploads.au.intercomcdn.com https://uploads.eu.intercomcdn.com https://uploads.intercomusercontent.com https://*.google-analytics.com https://*.analytics.google.com https://*.googletagmanager.com https://cdn.segment.com https://api.segment.io https://vitals.vercel-insights.com https://*.doubleclick.net https://analytics.google.com https://stats.g.doubleclick.net;
object-src 'none';
base-uri 'self';
form-action 'self' https://intercom.help https://api-iam.intercom.io https://api-iam.eu.intercom.io https://api-iam.au.intercom.io;
frame-src https://intercom-sheets.com https://www.intercom-reporting.com https://www.youtube.com https://player.vimeo.com https://fast.wistia.net https://*.doubleclick.net;
worker-src 'self' https://intercom-sheets.com https://www.intercom-reporting.com https://www.youtube.com https://player.vimeo.com https://fast.wistia.net;
media-src https://js.intercomcdn.com https://downloads.intercomcdn.com https://downloads.intercomcdn.eu https://downloads.au.intercomcdn.com;
frame-ancestors 'none';
manifest-src 'self' https://upstash.com;
`;
/** @type {import('next').NextConfig} */
const nextConfig = {
env: {
NEXT_PUBLIC_SITE_URL:
process.env.NODE_ENV === "development"
? "http://localhost:3000"
: "https://upstash.com",
},
reactStrictMode: false,
images: {
remotePatterns: [
{
protocol: "https",
hostname: "github.com",
},
{
protocol: "https",
hostname: "avatars.githubusercontent.com",
},
{
protocol: "https",
hostname: "cdn.bydefault.so",
},
{
protocol: "https",
hostname: "cdn.contentport.io",
},
{
protocol: "https",
hostname: "miro.medium.com",
},
],
},
rewrites: () => [
{
source: "/docs",
destination: "https://upstash.mintlify.dev/docs",
},
{ source: "/pricing", destination: "/pricing/redis" },
{
source: "/docs/:match*",
destination: "https://upstash.mintlify.dev/docs/:match*",
},
],
async headers() {
return [
{
source: "/(.*)",
headers: [
{
key: "Content-Security-Policy-Report-Only",
value: cspHeader.replace(/\n/g, ""),
},
],
},
{
// Advertise the LLM-friendly index on every page
source: "/(.*)",
headers: [
{
key: "Link",
value:
'<https://upstash.com/llms.txt>; rel="alternate"; type="text/plain"; title="LLM-friendly content index"',
},
],
},
{
// Blog HTML responses are content-negotiated against text/markdown,
// so caches must differentiate by Accept.
source: "/blog",
headers: [{ key: "Vary", value: "Accept" }],
},
{
source: "/blog/:slug",
headers: [{ key: "Vary", value: "Accept" }],
},
{
source: "/pricing/redis",
headers: [
{
key: "Link",
value:
'<https://upstash.com/pricing/redis.md>; rel="alternate"; type="text/markdown"; title="Redis Pricing (Markdown)"',
},
],
},
{
source: "/pricing/qstash",
headers: [
{
key: "Link",
value:
'<https://upstash.com/pricing/qstash.md>; rel="alternate"; type="text/markdown"; title="QStash Pricing (Markdown)"',
},
],
},
{
source: "/pricing/vector",
headers: [
{
key: "Link",
value:
'<https://upstash.com/pricing/vector.md>; rel="alternate"; type="text/markdown"; title="Vector Pricing (Markdown)"',
},
],
},
{
source: "/pricing/workflow",
headers: [
{
key: "Link",
value:
'<https://upstash.com/pricing/workflow.md>; rel="alternate"; type="text/markdown"; title="Workflow Pricing (Markdown)"',
},
],
},
{
source: "/pricing/search",
headers: [
{
key: "Link",
value:
'<https://upstash.com/pricing/search.md>; rel="alternate"; type="text/markdown"; title="Search Pricing (Markdown)"',
},
],
},
{
source: "/pricing/box",
headers: [
{
key: "Link",
value:
'<https://upstash.com/pricing/box.md>; rel="alternate"; type="text/markdown"; title="Box Pricing (Markdown)"',
},
],
},
];
},
};
module.exports = withContentCollections(nextConfig);