From c67e1a7a712db08d46f808106177f5168b31cdcb Mon Sep 17 00:00:00 2001 From: ltadeu6 Date: Mon, 25 May 2026 18:05:47 -0300 Subject: [PATCH] Add CORS header for Forgejo API via nginx (fix homepage project fetch) --- hosts/NixOracle/configuration.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/hosts/NixOracle/configuration.nix b/hosts/NixOracle/configuration.nix index 072eb3d..be57e3e 100644 --- a/hosts/NixOracle/configuration.nix +++ b/hosts/NixOracle/configuration.nix @@ -112,6 +112,15 @@ in { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; ''; }; + locations."/api/" = { + proxyPass = "http://127.0.0.1:3000"; + extraConfig = '' + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + add_header 'Access-Control-Allow-Origin' 'https://tadix.dev' always; + ''; + }; }; virtualHosts."biolab.tadix.dev" = { enableACME = true;