From 11d435c49b196791a644bb86a0795c2e6fac5cea Mon Sep 17 00:00:00 2001 From: k-brahma-dify Date: Sun, 13 Jul 2025 23:41:05 +0900 Subject: [PATCH] fix: add Next.js rewrites configuration for Docker environment - Add rewrites for /console/api, /api, /v1, and /files endpoints - Routes API requests from web container to api:5001 (Docker service name) - Fixes API communication issues in Docker environment - Enables proper MFA endpoint access without nginx dependency --- web/next.config.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/web/next.config.js b/web/next.config.js index 9ce1b35644..ef3c353b09 100644 --- a/web/next.config.js +++ b/web/next.config.js @@ -63,6 +63,26 @@ const nextConfig = { }, ] }, + async rewrites() { + return [ + { + source: '/console/api/:path*', + destination: 'http://api:5001/console/api/:path*', + }, + { + source: '/api/:path*', + destination: 'http://api:5001/api/:path*', + }, + { + source: '/v1/:path*', + destination: 'http://api:5001/v1/:path*', + }, + { + source: '/files/:path*', + destination: 'http://api:5001/files/:path*', + }, + ] + }, output: 'standalone', }