2026-02-14 11:47:26 +01:00
|
|
|
import type { NextConfig } from 'next';
|
2026-02-13 23:26:37 +01:00
|
|
|
|
2026-07-20 18:57:57 +02:00
|
|
|
/**
|
|
|
|
|
* Static security headers, applied to every response including /api and static
|
|
|
|
|
* assets, which middleware does not cover.
|
|
|
|
|
*
|
|
|
|
|
* The Content-Security-Policy is deliberately NOT set here: it needs a
|
|
|
|
|
* per-request nonce and is owned exclusively by middleware.ts. Keeping the two
|
|
|
|
|
* layers disjoint avoids emitting the same header twice with conflicting
|
|
|
|
|
* values, which browsers may resolve by ignoring the header altogether.
|
|
|
|
|
*/
|
|
|
|
|
const securityHeaders = [
|
|
|
|
|
{ key: 'X-Content-Type-Options', value: 'nosniff' },
|
|
|
|
|
{ key: 'X-Frame-Options', value: 'DENY' },
|
|
|
|
|
{ key: 'Referrer-Policy', value: 'strict-origin-when-cross-origin' },
|
|
|
|
|
{ key: 'Permissions-Policy', value: 'camera=(), microphone=(), geolocation=()' },
|
|
|
|
|
{ key: 'Strict-Transport-Security', value: 'max-age=31536000; includeSubDomains; preload' },
|
|
|
|
|
{ key: 'X-DNS-Prefetch-Control', value: 'off' },
|
|
|
|
|
];
|
2026-02-15 11:07:39 +01:00
|
|
|
|
2026-02-13 23:26:37 +01:00
|
|
|
const nextConfig: NextConfig = {
|
2026-02-14 00:59:57 +01:00
|
|
|
output: 'standalone',
|
2026-02-14 10:30:27 +01:00
|
|
|
images: {
|
|
|
|
|
loader: 'custom',
|
|
|
|
|
loaderFile: './lib/immichLoader.ts',
|
|
|
|
|
},
|
2026-02-15 11:07:39 +01:00
|
|
|
async headers() {
|
2026-07-20 18:57:57 +02:00
|
|
|
return [{ source: '/(.*)', headers: securityHeaders }];
|
2026-02-15 11:07:39 +01:00
|
|
|
},
|
2026-02-13 23:26:37 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default nextConfig;
|