canina/frontend/application/next.config.ts
parsa aghaei 6eb45cd467
All checks were successful
Deploy Canina / deploy (push) Successful in 1m55s
refactor: unify domain and contact emails to canina.ir across all apps and seeds
2026-08-19 11:52:36 +03:30

85 lines
1.9 KiB
TypeScript

import type { NextConfig } from "next";
const securityHeaders = [
{ key: 'X-DNS-Prefetch-Control', value: 'on' },
{ key: 'Strict-Transport-Security', value: 'max-age=63072000; includeSubDomains; preload' },
{ key: 'X-Frame-Options', value: 'SAMEORIGIN' },
{ key: 'X-Content-Type-Options', value: 'nosniff' },
{ key: 'Referrer-Policy', value: 'origin-when-cross-origin' },
{ key: 'Permissions-Policy', value: 'camera=(), microphone=(), geolocation=()' },
];
const nextConfig: NextConfig = {
images: {
formats: ['image/avif', 'image/webp'],
remotePatterns: [
{
protocol: 'https',
hostname: 'canina.ir',
},
{
protocol: 'https',
hostname: 'api.canina.ir',
},
{
protocol: 'https',
hostname: 'stage.canina.ir',
},
{
protocol: 'https',
hostname: 'stageapi.canina.ir',
},
{
protocol: 'https',
hostname: 'apicanina.parsaaghayi.ir',
},
{
protocol: 'https',
hostname: 'canina.de',
},
{
protocol: 'https',
hostname: 'www.canina.de',
},
{
protocol: 'https',
hostname: 'images.unsplash.com',
},
{
protocol: 'https',
hostname: 'plus.unsplash.com',
},
{
protocol: 'http',
hostname: 'localhost',
},
{
protocol: 'http',
hostname: '127.0.0.1',
},
],
},
async headers() {
return [
{
source: '/:path*',
headers: securityHeaders,
},
];
},
async rewrites() {
// Only proxy /api in development; in production nginx handles it
if (process.env.NODE_ENV === 'development') {
return [
{
source: '/api/:path*',
destination: 'http://localhost:4001/api/:path*',
},
];
}
return [];
},
};
export default nextConfig;