Replies: 4 comments 3 replies
-
I have a workaround in NGINX: Having lost a couple of days on this I suspect (but cannot entirely prove) that in the nextjs code the serverActions.allowedOrigins is not populated at the time it is needed in the call to isCsrfOriginAllowed |
Beta Was this translation helpful? Give feedback.
-
I have now the same problem when I update my project to Next.js 15. With version 14 is working correctly. |
Beta Was this translation helpful? Give feedback.
-
next.js/packages/next/src/server/app-render/action-handler.ts Lines 457 to 506 in 04571f3 |
Beta Was this translation helpful? Give feedback.
-
Next.js version 15.0.3 In my case I have a setup running on AWS with:
The error received is:
The fix for me was (in let nextConfig: NextConfig = {
output: "standalone",
experimental: {
serverActions: {
// Otherwise server actions don't work in AWS
// https://github.com/vercel/next.js/issues/58295
allowedOrigins: [
"my-alb-1123514176.eu-west-1.elb.amazonaws.com",
"mycompany.com",
],
},
},
};
export default nextConfig; This is not mentioned in the other main thread about this issue #58295 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
serverActions.allowedOrigins isnt working for me. Please can you advise what I'm missing?
The architecture is nginx > nextjs in Azure Container Apps. Only nginx is exposed on mysubdomain.domain.com. nginx proxies requests to nextjs using the ACA internal hostname. This results in an error:
I tried upgrading to 14.2.3.
Then I realised my original next.config.js wasnt being picked up so I converted it to next.config.mjs. I tested to make sure it was being picked up and it is (the upgrade resulted in some obsolete values)
I looked at the nextjs code, and decided that the only possibility is that serverActions.allowedOrigins is still not being populated.
I wrote a test using the function code from the repo source, and it worked fine.
Any ideas you have would be amazing. Thanks!
next.config.mjs:
Additional information
No response
Example
No response
Beta Was this translation helpful? Give feedback.
All reactions