fix: use https protocol in next config

This commit is contained in:
Ilia Mashkov
2026-05-21 18:01:03 +03:00
parent 4d54947a91
commit 3e520f6abb
2 changed files with 2 additions and 4 deletions
+1 -3
View File
@@ -3,7 +3,6 @@ import type { NextConfig } from 'next';
/* PocketBase origin — used to allowlist remote images. /* PocketBase origin — used to allowlist remote images.
* PB_HOSTNAME and PB_PORT are server-only env vars; safe to read here. */ * PB_HOSTNAME and PB_PORT are server-only env vars; safe to read here. */
const pbHostname = process.env.PB_HOSTNAME ?? '127.0.0.1'; const pbHostname = process.env.PB_HOSTNAME ?? '127.0.0.1';
const pbPort = process.env.PB_PORT ?? '8090';
const nextConfig: NextConfig = { const nextConfig: NextConfig = {
output: 'standalone', output: 'standalone',
@@ -11,9 +10,8 @@ const nextConfig: NextConfig = {
images: { images: {
remotePatterns: [ remotePatterns: [
{ {
protocol: 'http', protocol: 'https',
hostname: pbHostname, hostname: pbHostname,
port: pbPort,
pathname: '/api/files/**', pathname: '/api/files/**',
}, },
], ],
@@ -5,7 +5,7 @@ export function buildFileUrl(
collectionId: string, collectionId: string,
recordId: string, recordId: string,
filename: string, filename: string,
baseUrl: string = process.env.NEXT_PUBLIC_PB_URL ?? 'http://127.0.0.1:8090', baseUrl: string = process.env.PB_PUBLIC_URL ?? 'http://127.0.0.1:8090',
): string { ): string {
return `${baseUrl}/api/files/${collectionId}/${recordId}/${filename}`; return `${baseUrl}/api/files/${collectionId}/${recordId}/${filename}`;
} }