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
pull/22206/head
k-brahma-dify 10 months ago
parent bc9ff9b9b6
commit 11d435c49b

@ -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', output: 'standalone',
} }

Loading…
Cancel
Save