diff --git a/frontend/next.config.js b/frontend/next.config.js index a34a437..9d8da08 100644 --- a/frontend/next.config.js +++ b/frontend/next.config.js @@ -161,8 +161,12 @@ const nextConfig = { // Proxy API requests to backend // This ensures /api/v1/* works regardless of how the server is accessed async rewrites() { - // Determine backend URL based on environment - const backendUrl = process.env.BACKEND_URL || 'http://127.0.0.1:8000' + // In production (Docker), use internal container hostname + // In development, use localhost + const isProduction = process.env.NODE_ENV === 'production' + const backendUrl = process.env.BACKEND_URL || (isProduction ? 'http://pounce-backend:8000' : 'http://127.0.0.1:8000') + + console.log(`[Next.js Config] Backend URL: ${backendUrl}`) return [ {