docs(nxdev): add security headers (#11240)

This commit is contained in:
Benjamin Cabanes 2022-07-21 13:54:28 -04:00 committed by GitHub
parent b89e321753
commit 68a2a11ac4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -21,6 +21,24 @@ module.exports = withNx({
env: {
VERCEL: process.env.VERCEL,
},
async headers() {
return [
{
source: '/:path*',
headers: [
{ key: 'X-DNS-Prefetch-Control', value: 'on' },
{
key: 'Strict-Transport-Security',
value: 'max-age=63072000; includeSubDomains; preload',
},
{ key: 'X-XSS-Protection', value: '1; mode=block' },
{ key: 'X-Content-Type-Options', value: 'nosniff' },
{ key: 'X-Frame-Options', value: 'DENY' },
{ key: 'Referrer-Policy', value: 'no-referrer' },
],
},
];
},
async redirects() {
const rules = [];