From 8a8086176b13e996318933b3d302a114d4bfff79 Mon Sep 17 00:00:00 2001 From: Anish Sarkar <104695310+AnishSarkar22@users.noreply.github.com> Date: Tue, 21 Apr 2026 11:17:24 +0530 Subject: [PATCH] refactor: removed `BACKEND_PROXY_TARGET` and unified `FASTAPI_BACKEND_INTERNAL_URL` for both next.js rewrite and docker network issues --- surfsense_web/.env.example | 4 ++-- surfsense_web/next.config.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/surfsense_web/.env.example b/surfsense_web/.env.example index 05d27f2b4..9b54edc13 100644 --- a/surfsense_web/.env.example +++ b/surfsense_web/.env.example @@ -1,8 +1,8 @@ NEXT_PUBLIC_FASTAPI_BACKEND_URL=http://localhost:8000 -# Server-only. Backend URL behind the /api/v1/* proxy in next.config.ts. +# Server-only. Internal backend URL used by Next.js server code. # Falls back to NEXT_PUBLIC_FASTAPI_BACKEND_URL when unset. -BACKEND_PROXY_TARGET=https://your-internal-backend.example.com +FASTAPI_BACKEND_INTERNAL_URL=https://your-internal-backend.example.com NEXT_PUBLIC_FASTAPI_BACKEND_AUTH_TYPE=LOCAL or GOOGLE NEXT_PUBLIC_ETL_SERVICE=UNSTRUCTURED or LLAMACLOUD or DOCLING diff --git a/surfsense_web/next.config.ts b/surfsense_web/next.config.ts index e291c4102..6aed14d95 100644 --- a/surfsense_web/next.config.ts +++ b/surfsense_web/next.config.ts @@ -45,10 +45,10 @@ const nextConfig: NextConfig = { }, // Proxy /api/v1/* to the FastAPI backend. Keeps the real backend host - // out of the client bundle. BACKEND_PROXY_TARGET is server-only. + // out of the client bundle. FASTAPI_BACKEND_INTERNAL_URL is server-only. async rewrites() { const target = - process.env.BACKEND_PROXY_TARGET || + process.env.FASTAPI_BACKEND_INTERNAL_URL || process.env.NEXT_PUBLIC_FASTAPI_BACKEND_URL || "http://localhost:8000"; return [