Files
Assclaw a6a4a9aa24
Magent CI/CD / verify (push) Successful in 4m41s
Magent CI/CD / deploy-beta (push) Successful in 1m40s
fix: apply CSP nonce to Next scripts
2026-09-17 22:51:23 +12:00

41 lines
1.1 KiB
JavaScript

const backendUrl = process.env.BACKEND_INTERNAL_URL || "http://backend:8000";
/** @type {import('next').NextConfig} */
const nextConfig = {
poweredByHeader: false,
compress: true,
experimental: { proxyTimeout: 180000 },
async headers() {
return [
{
source: "/:path*",
headers: [
{ key: "Strict-Transport-Security", value: "max-age=31536000; includeSubDomains" },
{ key: "X-Content-Type-Options", value: "nosniff" },
{ key: "X-Frame-Options", value: "DENY" },
{ key: "Referrer-Policy", value: "no-referrer" },
{ key: "Permissions-Policy", value: "camera=(), microphone=(), geolocation=()" },
],
},
{
source: "/login",
headers: [{ key: "Cache-Control", value: "private, no-store, max-age=0" }],
},
];
},
async rewrites() {
return [
{
source: "/favicon.ico",
destination: `${backendUrl}/branding/favicon.ico`,
},
{
source: "/api/:path*",
destination: `${backendUrl}/:path*`,
},
];
},
};
module.exports = nextConfig;