Skip to content

Commit 11190f8

Browse files
committed
fix: try fix image load 502 in netlify
1 parent 3c9d62c commit 11190f8

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

.env.example

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
NEXT_PUBLIC_SITE_HOST=https://example.com
2-
NEXT_PUBLIC_IMAGE_DOMAIN=example.com
32

43
# http 无法访问 https,也可使用 next dev --experimental-https 生成证书
54
NODE_TLS_REJECT_UNAUTHORIZED=0

netlify.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
1-
[[plugins]]
1+
[[plugins]]
22
package = "@netlify/plugin-nextjs"
3+
[images]
4+
# https://docs.netlify.com/image-cdn/overview/#remote-path
5+
remote_images = ["https://jsonq.top/dns-static/.*"]

next.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import type { RemotePattern } from 'next/dist/shared/lib/image-config';
44
const imageRemotes: RemotePattern[] = [
55
{ hostname: 'testingcf.jsdelivr.net', pathname: '/**' },
66
{ hostname: 'cdn.jsdelivr.net', pathname: '/**' },
7-
{ hostname: process.env.NEXT_PUBLIC_IMAGE_DOMAIN || '', pathname: '/cdn-static/**' },
7+
{ hostname: 'jsonq.top', pathname: '/cdn-static/**' },
88
].map((item) => ({
99
protocol: 'https',
1010
hostname: item.hostname,

0 commit comments

Comments
 (0)