feat: align analytics and error naming standards and fix Umami proxy

This commit is contained in:
2026-02-12 16:55:20 +01:00
parent 11a782a5ab
commit e800c1fbe0
4 changed files with 33 additions and 0 deletions

View File

@@ -322,6 +322,15 @@ const nextConfig = {
contentSecurityPolicy: "default-src 'self'; script-src 'none'; sandbox;",
},
async rewrites() {
const umamiUrl =
process.env.UMAMI_API_ENDPOINT ||
process.env.UMAMI_SCRIPT_URL ||
process.env.NEXT_PUBLIC_UMAMI_SCRIPT_URL ||
'https://analytics.infra.mintel.me';
const glitchtipUrl = process.env.SENTRY_DSN
? new URL(process.env.SENTRY_DSN).origin
: 'https://errors.infra.mintel.me';
const directusUrl = process.env.INTERNAL_DIRECTUS_URL || process.env.DIRECTUS_URL || 'https://cms.klz-cables.com';
return [
@@ -329,6 +338,14 @@ const nextConfig = {
source: '/cms/:path*',
destination: `${directusUrl}/:path*`,
},
{
source: '/stats/:path*',
destination: `${umamiUrl}/:path*`,
},
{
source: '/errors/:path*',
destination: `${glitchtipUrl}/:path*`,
},
];
},
};