Files
modstagram-next/next.config.ts
2026-07-08 06:48:44 +03:30

77 lines
2.1 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/** @type {import('next').NextConfig} */
const nextConfig = {
// ۱. نادیده گرفتن خطاهای بیلد
eslint: {
ignoreDuringBuilds: true,
},
typescript: {
ignoreBuildErrors: true,
},
// ۲. تنظیمات تصاویر
images: {
remotePatterns: [
{
protocol: 'https',
hostname: 'app.modstagram.ir',
port: '',
pathname: '/**',
},
{
protocol: 'https',
hostname: 'blog.modstagram.com', // اجازه دادن به نمایش تصاویر وبلاگ
port: '',
pathname: '/**',
},
{
protocol: 'http',
hostname: 'localhost',
port: '',
pathname: '/**',
},
],
formats: ['image/avif', 'image/webp'],
deviceSizes: [640, 750, 828, 1080, 1200, 1920, 2048, 3840],
imageSizes: [16, 32, 48, 64, 96, 128, 256, 384],
minimumCacheTTL: 31536000,
},
// ۳. هدایت ترافیک ساب‌فولدر به وردپرس (بخش جدید)
async rewrites() {
return [
{
source: '/blog',
destination: 'https://blog.modstagram.com/blog',
},
{
source: '/blog/:path*',
destination: 'https://blog.modstagram.com/blog/:path*',
},
];
},
server: {
port: 3004,
},
// ۴. تنظیمات هدرها
async headers() {
return [
{
source: '/(.*)',
headers: [
{ key: 'X-DNS-Prefetch-Control', value: 'on' },
{ key: 'Strict-Transport-Security', value: 'max-age=63072000; includeSubDomains; preload' },
{ key: 'X-XSS-Protection', value: '1; mode=block' },
{ key: 'X-Frame-Options', value: 'SAMEORIGIN' },
{ key: 'X-Content-Type-Options', value: 'nosniff' },
{ key: 'Referrer-Policy', value: 'origin-when-cross-origin' },
{ key: 'Cache-Control', value: 'public, s-maxage=1, stale-while-revalidate=59' },
],
},
];
},
reactStrictMode: false,
};
export default nextConfig;