/** @type {import('next').NextConfig} */ const nextConfig = { output: "standalone", images: { remotePatterns: [ { protocol: "http", hostname: "localhost", port: "9000", pathname: "/drink-images/**", }, { protocol: "https", hostname: "*.amazonaws.com", pathname: "/**", }, ], }, async rewrites() { // Proxy image requests to MinIO so URLs work from any device const minioHost = process.env.MINIO_ENDPOINT || "localhost"; const minioPort = process.env.MINIO_PORT || "9000"; const minioBucket = process.env.MINIO_BUCKET || "drink-images"; return [ { source: "/minio-images/:path*", destination: `http://${minioHost}:${minioPort}/${minioBucket}/:path*`, }, ]; }, async headers() { return [ { source: "/(.*)", headers: [ { key: "X-Frame-Options", value: "DENY", }, { key: "X-Content-Type-Options", value: "nosniff", }, { key: "Referrer-Policy", value: "strict-origin-when-cross-origin", }, { key: "X-DNS-Prefetch-Control", value: "on", }, { key: "Strict-Transport-Security", value: "max-age=63072000; includeSubDomains; preload", }, { key: "Permissions-Policy", value: "camera=(self), microphone=(), geolocation=(), interest-cohort=()", }, { key: "Content-Security-Policy", value: [ "default-src 'self'", "script-src 'self' 'unsafe-inline' 'unsafe-eval'", "style-src 'self' 'unsafe-inline'", "img-src 'self' data: blob: http://localhost:9000 https://*.amazonaws.com", "font-src 'self'", "connect-src 'self' http://localhost:9000", "frame-ancestors 'none'", "base-uri 'self'", "form-action 'self'", ].join("; "), }, ], }, ]; }, }; export default nextConfig;