feat(infra): configure imgproxy to use next.js rewrite proxy
- Added /_img/ rewrite rule in next.config.mjs to proxy image requests to IMGPROXY_URL - Updated lib/imgproxy.ts to use local /_img path instead of exposed public URL - Replaced NEXT_PUBLIC_IMGPROXY_URL (build-time) with IMGPROXY_URL (runtime) - Updated Dockerfile and docker-compose.yml to strip unused build args
This commit is contained in:
@@ -30,10 +30,8 @@ function encodeBase64(str: string): string {
|
||||
}
|
||||
|
||||
export function getImgproxyUrl(src: string, options: ImgproxyOptions = {}): string {
|
||||
const baseUrl = process.env.NEXT_PUBLIC_IMGPROXY_URL || 'https://img.infra.mintel.me';
|
||||
|
||||
// If no imgproxy URL is configured, return the source as is
|
||||
if (!baseUrl) return src;
|
||||
// Use local proxy path which is rewritten in next.config.mjs
|
||||
const baseUrl = '/_img';
|
||||
|
||||
// Handle local paths or relative URLs
|
||||
let absoluteSrc = src;
|
||||
|
||||
Reference in New Issue
Block a user