Files
webshop/shop/next.config.ts
DanielS 5bad959b13
All checks were successful
Staging Build / build (push) Successful in 3m28s
fix: change default internal rewrite and server resolution host to kong
2026-07-04 17:19:09 +02:00

48 lines
1.3 KiB
TypeScript

import type { NextConfig } from "next";
const nextConfig: NextConfig = {
output: "standalone",
cacheComponents: false,
poweredByHeader: false,
async headers() {
return [
{
source: '/:path*',
headers: [
{
key: 'X-Frame-Options',
value: 'SAMEORIGIN',
},
{
key: 'X-Content-Type-Options',
value: 'nosniff',
},
{
key: 'Content-Security-Policy',
value: "default-src 'self'; script-src 'self' 'unsafe-eval' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; img-src 'self' blob: data:; font-src 'self' data:; connect-src 'self' https://*.supabase.co wss://*.supabase.co https://*.supabase.net wss://*.supabase.net; frame-ancestors 'self'; form-action 'self';",
},
],
},
];
},
async rewrites() {
const supabaseUrl = (process.env.SUPABASE_URL || "http://kong:8000").replace(/\/$/, "");
return [
{
source: '/auth/v1/:path*',
destination: `${supabaseUrl}/auth/v1/:path*`,
},
{
source: '/rest/v1/:path*',
destination: `${supabaseUrl}/rest/v1/:path*`,
},
{
source: '/storage/v1/:path*',
destination: `${supabaseUrl}/storage/v1/:path*`,
},
];
},
};
export default nextConfig;