We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3c1f4d2 commit 84bdb48Copy full SHA for 84bdb48
next.config.mjs
@@ -58,7 +58,7 @@ const nextraConfig = withNextra({
58
],
59
},
60
headers() {
61
- return [
+ const headers = [
62
{
63
source: "/:path*",
64
headers: [
@@ -89,7 +89,22 @@ const nextraConfig = withNextra({
89
90
91
92
- ]
+ ];
93
+
94
+ // Do not index Vercel preview deployments
95
+ if (process.env.NEXT_PUBLIC_VERCEL_ENV === 'preview') {
96
+ headers.push({
97
+ headers: [
98
+ {
99
+ key: 'X-Robots-Tag',
100
+ value: 'noindex',
101
+ },
102
+ ],
103
+ source: '/:path*',
104
+ });
105
+ }
106
107
+ return headers;
108
109
redirects: async () => [
110
...nonPermanentRedirects.map(([source, destination]) => ({
0 commit comments