41 lines
1.1 KiB
JavaScript
41 lines
1.1 KiB
JavaScript
/** @type {import('next').NextConfig} */
|
|
const nextConfig = {
|
|
output: "standalone",
|
|
async headers() {
|
|
const isDev = process.env.NODE_ENV === "development";
|
|
const csp = [
|
|
"default-src 'self'",
|
|
"base-uri 'self'",
|
|
"frame-ancestors 'none'",
|
|
"object-src 'none'",
|
|
"form-action 'self'",
|
|
"img-src 'self' data:",
|
|
isDev
|
|
? "script-src 'self' 'unsafe-eval' 'unsafe-inline'"
|
|
: "script-src 'self'",
|
|
"style-src 'self' 'unsafe-inline'",
|
|
"connect-src 'self'",
|
|
].join("; ");
|
|
|
|
return [
|
|
{
|
|
source: "/(.*)",
|
|
headers: [
|
|
{ key: "Content-Security-Policy", value: csp },
|
|
{ key: "X-Frame-Options", value: "DENY" },
|
|
{ key: "X-Content-Type-Options", value: "nosniff" },
|
|
{ key: "Referrer-Policy", value: "no-referrer" },
|
|
{
|
|
key: "Strict-Transport-Security",
|
|
value: "max-age=63072000; includeSubDomains; preload",
|
|
},
|
|
{ key: "Permissions-Policy", value: "geolocation=(), microphone=(), camera=()" },
|
|
],
|
|
},
|
|
];
|
|
},
|
|
};
|
|
|
|
module.exports = nextConfig;
|
|
|