mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-11 21:52:32 +00:00
70 lines
1.6 KiB
JavaScript
Executable File
70 lines
1.6 KiB
JavaScript
Executable File
import createNextIntlPlugin from "next-intl/plugin";
|
|
|
|
const withNextIntl = createNextIntlPlugin();
|
|
|
|
/** @type {import('next').NextConfig} */
|
|
|
|
const secureHeaders = [
|
|
{
|
|
key: "Strict-Transport-Security",
|
|
value: "max-age=63072000; includeSubDomains; preload",
|
|
},
|
|
{
|
|
key: "Referrer-Policy",
|
|
value: "origin-when-cross-origin",
|
|
},
|
|
{
|
|
key: "X-Frame-Options",
|
|
value: "SAMEORIGIN",
|
|
},
|
|
{
|
|
key: "X-Content-Type-Options",
|
|
value: "nosniff",
|
|
},
|
|
{
|
|
key: "X-XSS-Protection",
|
|
value: "1; mode=block",
|
|
},
|
|
// img-src vercel.com needed for deploy button,
|
|
// script-src va.vercel-scripts.com for analytics/vercel scripts
|
|
{
|
|
key: "Content-Security-Policy",
|
|
value:
|
|
"default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://va.vercel-scripts.com; connect-src 'self'; child-src; style-src 'self' 'unsafe-inline'; font-src 'self'; object-src 'none'; img-src 'self' https://vercel.com;",
|
|
},
|
|
];
|
|
|
|
const nextConfig = {
|
|
basePath: "./",
|
|
reactStrictMode: true, // Recommended for the `pages` directory, default in `app`.
|
|
experimental: {
|
|
dynamicIO: true,
|
|
},
|
|
images: {
|
|
remotePatterns: [
|
|
{
|
|
protocol: "https",
|
|
hostname: process.env.ZITADEL_API_URL?.replace("https://", "") || "",
|
|
port: "",
|
|
pathname: "/**",
|
|
},
|
|
{
|
|
protocol: "http",
|
|
hostname: "localhost",
|
|
port: "8080",
|
|
pathname: "/**",
|
|
},
|
|
],
|
|
},
|
|
async headers() {
|
|
return [
|
|
{
|
|
source: "/:path*",
|
|
headers: secureHeaders,
|
|
},
|
|
];
|
|
},
|
|
};
|
|
|
|
export default withNextIntl(nextConfig);
|