From 762aebf820b397b6135f2012d3868fe963c86718 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikola=20Dere=C5=BEi=C4=87?= Date: Wed, 10 Jan 2024 21:36:44 +0100 Subject: [PATCH] commenting code --- next.config.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/next.config.js b/next.config.js index 04864ae..17c5061 100644 --- a/next.config.js +++ b/next.config.js @@ -6,8 +6,13 @@ const nextConfig = { // - `'export'`: An exported build output, `out` directory, that only includes static HTML/CSS/JS. Useful for self-hosting without a Node.js server. output: "standalone", // needed for running the app in a Docker container experimental: { - // https://github.com/vercel/next.js/issues/58295 - serverActions: { allowedOrigins: ["rezije.app", "rezije.app:80", "localhost:3001"], } + // "x-forwarded-host" is a HTTP header added by a reverse proxy, + // and it contains the original host requested by the client + // this is needed for the server to know which host to render + // This however differs from the "Host" header, which results in + // server rejecting API requests from the client + // So here we tell Next.JS to accept requests where the "x-forwarded-host" equals and of the following values + serverActions: { allowedOrigins: ["rezije.app", "rezije.app:80", "localhost:3001", "0.0.0.0:80"], } } };