Files
lotteryFront/next.config.ts

33 lines
654 B
TypeScript

import type { NextConfig } from "next";
import { securityHeaders } from "./src/lib/csp-config";
const lotteryApiProxyTarget =
process.env.LOTTERY_API_PROXY_TARGET?.trim() || "http://127.0.0.1:8000";
const nextConfig: NextConfig = {
allowedDevOrigins: ["192.168.0.101"],
reactCompiler: true,
// 安全头配置 - 支持 iframe 嵌入
async headers() {
return [
{
source: "/:path*",
headers: securityHeaders,
},
];
},
async rewrites() {
return [
{
source: "/api/:path*",
destination: `${lotteryApiProxyTarget}/api/:path*`,
},
];
},
};
export default nextConfig;