Files
HoruxDespachos/apps/web/next.config.js
2026-04-27 22:09:36 -06:00

37 lines
1.1 KiB
JavaScript

/** @type {import('next').NextConfig} */
const nextConfig = {
transpilePackages: ['@horux/shared'],
async rewrites() {
return [
{
source: '/api/:path*',
destination: 'http://localhost:4000/api/:path*',
},
{
source: '/health',
destination: 'http://localhost:4000/health',
},
];
},
// Security headers aplicados a todas las rutas. Protegen de clickjacking
// (terceros embebiendo Horux 360 en iframes propios), MIME sniffing y
// referrer leakage. Nuestro propio /terminos embebe el PDF desde el mismo
// origen así que frame-ancestors 'self' no lo rompe.
async headers() {
return [
{
source: '/:path*',
headers: [
{ key: 'X-Frame-Options', value: 'SAMEORIGIN' },
{ key: 'Content-Security-Policy', value: "frame-ancestors 'self'" },
{ key: 'X-Content-Type-Options', value: 'nosniff' },
{ key: 'Referrer-Policy', value: 'strict-origin-when-cross-origin' },
{ key: 'Strict-Transport-Security', value: 'max-age=31536000; includeSubDomains' },
],
},
];
},
};
module.exports = nextConfig;