64 lines
1.4 KiB
JavaScript
64 lines
1.4 KiB
JavaScript
/** @type {import('next').NextConfig} */
|
||
const nextConfig = {
|
||
output: 'standalone',
|
||
images: {
|
||
remotePatterns: [
|
||
{
|
||
protocol: 'https',
|
||
hostname: 's3.1080p.hk',
|
||
},
|
||
{
|
||
protocol: 'http',
|
||
hostname: 's3.1080p.hk',
|
||
},
|
||
{
|
||
protocol: 'https',
|
||
hostname: 's3.yydd.ai',
|
||
},
|
||
{
|
||
protocol: 'http',
|
||
hostname: 's3.yydd.ai',
|
||
},
|
||
],
|
||
},
|
||
experimental: {
|
||
serverActions: {
|
||
bodySizeLimit: '10gb', // Server Actions 的限制 (10GB)
|
||
},
|
||
},
|
||
// 注意:CORS配置移到middleware.ts中处理,因为需要动态设置origin
|
||
// 当使用credentials时,不能使用通配符*
|
||
|
||
// 添加版本号到静态资源文件名,强制浏览器更新
|
||
generateBuildId: async () => {
|
||
// 使用时间戳作为构建ID,确保每次部署都有新的版本号
|
||
return `build-${Date.now()}`
|
||
},
|
||
|
||
// 配置 headers 来禁用缓存
|
||
async headers() {
|
||
return [
|
||
{
|
||
source: '/:path*',
|
||
headers: [
|
||
{
|
||
key: 'X-Content-Type-Options',
|
||
value: 'nosniff',
|
||
},
|
||
{
|
||
key: 'X-Frame-Options',
|
||
value: 'SAMEORIGIN',
|
||
},
|
||
{
|
||
key: 'X-XSS-Protection',
|
||
value: '1; mode=block',
|
||
},
|
||
],
|
||
},
|
||
]
|
||
},
|
||
}
|
||
|
||
module.exports = nextConfig
|
||
|