fix: add Next.js API route handler to proxy with correct host headers
This commit is contained in:
@@ -10,10 +10,29 @@ const nextConfig: NextConfig = {
|
||||
{
|
||||
source: "/api/:path*",
|
||||
destination: "http://backend:8080/api/:path*",
|
||||
has: [
|
||||
{
|
||||
type: "header",
|
||||
key: "X-Forwarded-Host",
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
headers: async () => {
|
||||
return [
|
||||
{
|
||||
source: "/api/:path*",
|
||||
headers: [
|
||||
{
|
||||
key: "X-Forwarded-For",
|
||||
value: "127.0.0.1",
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
},
|
||||
};
|
||||
|
||||
export default nextConfig;
|
||||
|
||||
Reference in New Issue
Block a user