From d228db5f781bbdb8969c1d20ecea1a011b90bdf4 Mon Sep 17 00:00:00 2001 From: MarkLo Date: Fri, 21 Nov 2025 12:15:44 +0800 Subject: [PATCH] --- frontend/next.config.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/next.config.js b/frontend/next.config.js index ae4454ac..e9495e61 100644 --- a/frontend/next.config.js +++ b/frontend/next.config.js @@ -1,10 +1,14 @@ const nextConfig = { output: 'standalone', async rewrites() { + // Use BACKEND_URL env var, or fallback to public Railway URL + // In Railway, services cannot use simple hostnames to communicate + const backendUrl = process.env.BACKEND_URL || "https://tradingagents-backend.up.railway.app"; + return [ { source: "/api/:path*", - destination: `${process.env.API_URL || "http://backend:8000"}/api/:path*`, + destination: `${backendUrl}/api/:path*`, }, ]; },