ERROR `x-forwarded-host` header with value `example.netlify.app:80` does not match `origin` header with value `example.netlify.app` from a forwarded Server Actions request

My site is conversations-gcbc.netlify.app, built with NextJS v14.0.2. The /profile page uses a Server Action form to add an entry to state on the server, but it fails with this message in the brower:

Application error: a server-side exception has occurred (see the server logs for more information).

Digest: 1150005166

In the logs, for Function Next.js SSR handler, I find:

Nov 17, 03:17:00 PM: 7f43a7dc ERROR  `x-forwarded-host` header with value `conversations-gcbc.netlify.app:80` does not match `origin` header with value `conversations-gcbc.netlify.app` from a forwarded Server Actions request. Aborting the action.
Nov 17, 03:17:00 PM: 7f43a7dc ERROR  Error: Invalid Server Actions request.
    at rc (/var/task/node_modules/.pnpm/next@14.0.2_react-dom@18.2.0_react@18.2.0_sass@1.69.5/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:14:4679)
    at rj (/var/task/node_modules/.pnpm/next@14.0.2_react-dom@18.2.0_react@18.2.0_sass@1.69.5/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:15:21994)
    at /var/task/node_modules/.pnpm/next@14.0.2_react-dom@18.2.0_react@18.2.0_sass@1.69.5/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:15:24264
    at AsyncLocalStorage.run (node:async_hooks:338:14)
    at Object.wrap (/var/task/node_modules/.pnpm/next@14.0.2_react-dom@18.2.0_react@18.2.0_sass@1.69.5/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:242796)
    at /var/task/node_modules/.pnpm/next@14.0.2_react-dom@18.2.0_react@18.2.0_sass@1.69.5/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:15:24154
    at AsyncLocalStorage.run (node:async_hooks:338:14)
    at Object.wrap (/var/task/node_modules/.pnpm/next@14.0.2_react-dom@18.2.0_react@18.2.0_sass@1.69.5/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:242323)
    at rI (/var/task/node_modules/.pnpm/next@14.0.2_react-dom@18.2.0_react@18.2.0_sass@1.69.5/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:15:24081)
    at r2.render (/var/task/node_modules/.pnpm/next@14.0.2_react-dom@18.2.0_react@18.2.0_sass@1.69.5/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:15:28129)

I tried the exact same project code on Vercel and it work there. I would rather host this application with you! Can you help, please?

Port 80 seems suspicious to me - why is that set?

Next.js 14 is not much supported on Netlify right now. Last known working version is 13.3 and to some extent 13.4. Support for newer versions will be available in a few weeks.

Oh, thank you for letting me know.

Is this information published in the help pages anywhere? It would save me bothering you to find out when you support v14.

As of right now it’s not listed anywhere in our docs.

I got the same error for next js version: 14.1.4

I deployed it on nov 24 2024 It worked fine previously on netlify. But from yesterday its getting this same error . Can you help me fixing this error.

Do you really think its netlify problem?

If you’re using Runtime v5, you should not be having any errors.

I’m having the same issue, deployed in April and it worked fine. Now I’m getting this error. No runtime specified anywhere, so should be using v5, correct?

Can’t say since you haven’t mentioned any site or reproduction URL, but you might be runninng into: Something strange instead of my domain in oauth Redirect URI

1 Like

Correct. All these issues seem to be the same related to an unexpected proxy instead of the hostname. In my case, I’m using vercel-commerce and shopify (without any modification). Seems like any server action triggers the error.

This should now be resolved, could you let us know if you’re still seeing issues? Thanks!

Perfect, can confirm! Thanks for the quick reaction!

1 Like