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:
2026-02-18 15:57:44 +01:00
parent 38cf6a8d75
commit 95d0d094e1
6 changed files with 25 additions and 11 deletions

View File

@@ -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;