Files
Magent/frontend/next.config.js
T
Assclaw fd6671cf7e
Magent CI/CD / verify (push) Successful in 5m20s
Magent CI/CD / deploy-beta (push) Successful in 1m41s
feat: add backup recovery, setup wizard and user-view guards
2026-09-18 17:23:03 +12:00

43 lines
1.3 KiB
JavaScript

const backendUrl = process.env.BACKEND_INTERNAL_URL || "http://backend:8000";
/** @type {import('next').NextConfig} */
const nextConfig = {
poweredByHeader: false,
compress: true,
// API rewrites clone bodies even when excluded from proxy.ts's matcher.
// Match the backend restore envelope cap (32 MiB backup + multipart margin).
experimental: { proxyTimeout: 180000, proxyClientMaxBodySize: 34 * 1024 * 1024 },
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;