Skip to content

Commit 9f7932e

Browse files
authored
Merge pull request #1338 from avorylli/fix
Add security headers to Next.js config
2 parents dbeda4e + b32e542 commit 9f7932e

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

next.config.mjs

+26
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,32 @@ export default {
1717
eslint: {
1818
ignoreDuringBuilds: true,
1919
},
20+
21+
async headers() {
22+
return [
23+
{
24+
source: '/:path*',
25+
headers: [
26+
{
27+
key: 'X-DNS-Prefetch-Control',
28+
value: 'on'
29+
},
30+
{
31+
key: 'Strict-Transport-Security',
32+
value: 'max-age=31536000; includeSubDomains; preload'
33+
},
34+
{
35+
key: 'X-Content-Type-Options',
36+
value: 'nosniff'
37+
},
38+
{
39+
key: 'X-Frame-Options',
40+
value: 'DENY'
41+
}
42+
],
43+
},
44+
]
45+
},
2046

2147
// Don't put redirects here
2248
// they go in public/_redirects

0 commit comments

Comments
 (0)