31 lines
992 B
TypeScript
31 lines
992 B
TypeScript
import type { NextConfig } from "next";
|
|
|
|
// HTTP-Security-Header für alle Routen.
|
|
// HTTPS/HSTS übernimmt im Live-Betrieb der Reverse-Proxy.
|
|
const securityHeaders = [
|
|
// Verhindert Einbettung in fremde Seiten (Clickjacking)
|
|
{ key: "X-Frame-Options", value: "DENY" },
|
|
{ key: "Content-Security-Policy", value: "frame-ancestors 'none'" },
|
|
// Browser darf Content-Types nicht "erraten"
|
|
{ key: "X-Content-Type-Options", value: "nosniff" },
|
|
// Keine vollständigen URLs an fremde Seiten weitergeben
|
|
{ key: "Referrer-Policy", value: "strict-origin-when-cross-origin" },
|
|
// Sensorische APIs werden nicht benötigt
|
|
{ key: "Permissions-Policy", value: "camera=(), microphone=(), geolocation=()" },
|
|
];
|
|
|
|
const nextConfig: NextConfig = {
|
|
// Für den Docker-Betrieb: minimales, eigenständiges Server-Bundle
|
|
output: "standalone",
|
|
async headers() {
|
|
return [
|
|
{
|
|
source: "/(.*)",
|
|
headers: securityHeaders,
|
|
},
|
|
];
|
|
},
|
|
};
|
|
|
|
export default nextConfig;
|