I'm making a website by using next.js. After deploying my project by Vercel, login api gives me 502 error.
const nextConfig = {
reactStrictMode: true,
images: {
domains: [process.env.ORIGINAL_DATA, process.env.CONVERT_DATA]
},
swcMinify: true,
env: {
ORIGINAL_DATA : `https://${process.env.ORIGINAL_DATA}`,
CONVERT_DATA : `https://${process.env.CONVERT_DATA}`,
},
async rewrites() {
return [
{
source: "/api/:path*",
destination: `http://${process.env.API}api/:path*`,
},
{
source: "/video/:filename*",
destination: `https://${process.env.CONVERT_DATA}:filename*`,
}
]
},
}
My config codes are here. In development mode, it does work. Does anyone know why this is happening?? is there something wrong in rewrites fnc??
I double checked env variables... I've cleaned cache and cookies...