-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathnext.config.js
More file actions
77 lines (76 loc) · 2.43 KB
/
next.config.js
File metadata and controls
77 lines (76 loc) · 2.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/** @type {import('next').NextConfig} */
const nextConfig = {
// Configuration for Next.js Image component
images: {
// Legacy configuration for static domain allowlist
domains: [
"pub-your-account.r2.dev", // Cloudflare R2 bucket domain for storing user uploads
"ik.imagekit.io", // ImageKit CDN domain for optimized image delivery
"lh3.googleusercontent.com", // Google profile images
"lh4.googleusercontent.com", // Google profile images (alternative)
"lh5.googleusercontent.com", // Google profile images (alternative)
"lh6.googleusercontent.com", // Google profile images (alternative)
"ui-avatars.com", // UI Avatars service for fallback avatars
"localhost", // Allow localhost for development API endpoints
],
// Modern pattern-based configuration for external image sources
remotePatterns: [
{
protocol: "https",
hostname: "*.r2.cloudflarestorage.com", // Cloudflare R2 storage pattern
pathname: "/**",
},
{
protocol: "https",
hostname: "*.r2.dev", // R2 developer domains pattern
pathname: "/**",
},
{
protocol: "https",
hostname: "*.cloudflare.com", // General Cloudflare domains pattern
pathname: "/**",
},
{
protocol: "https",
hostname: "*.googleusercontent.com", // Google profile images and content
pathname: "/**",
},
{
protocol: "https",
hostname: "ui-avatars.com", // UI Avatars service for fallback avatars
pathname: "/api/**",
},
{
protocol: "http",
hostname: "localhost", // Development server HTTP
pathname: "/api/**",
},
{
protocol: "https",
hostname: "localhost", // Development server HTTPS
pathname: "/api/**",
},
{
protocol: "https",
hostname: "*.vercel.app", // Vercel deployment domains
pathname: "/api/**",
},
{
protocol: "https",
hostname: "*.netlify.app", // Netlify deployment domains
pathname: "/api/**",
},
{
protocol: "https",
hostname: "*.herokuapp.com", // Heroku deployment domains
pathname: "/api/**",
},
{
protocol: "https",
hostname: process.env.NEXT_PUBLIC_DOMAIN || "code102.site", // Custom production domain
pathname: "/api/**",
},
],
},
};
export default nextConfig;