fix: resolve CORS issue for mask images by proxying through Next.js rewrites

This commit is contained in:
Mustafa Yildiz
2026-07-18 15:01:49 +03:00
parent 392ada664d
commit 4c06c7ee32
2 changed files with 11 additions and 2 deletions
+3 -2
View File
@@ -21,14 +21,15 @@ export default function DynamicLogo({
}: DynamicLogoProps) {
const imageUrl = src.startsWith('/') ? openinaryLoader({ src, width: 800 }) : src;
const proxiedUrl = imageUrl.replace('https://media.ayris.tech', '/media-proxy');
return (
<div
className={className}
style={{
backgroundColor: color,
maskImage: `url(${imageUrl})`,
WebkitMaskImage: `url(${imageUrl})`,
maskImage: `url(${proxiedUrl})`,
WebkitMaskImage: `url(${proxiedUrl})`,
maskRepeat: "no-repeat",
maskPosition: "center",
maskSize: size,
+8
View File
@@ -28,6 +28,14 @@ const nextConfig: NextConfig = {
],
},
output: 'standalone',
async rewrites() {
return [
{
source: '/media-proxy/:path*',
destination: 'https://media.ayris.tech/:path*',
},
];
},
};
export default nextConfig;