Add CORS header for Forgejo API via nginx (fix homepage project fetch)

This commit is contained in:
ltadeu6 2026-05-25 18:05:47 -03:00
parent 9208326389
commit c67e1a7a71
No known key found for this signature in database
GPG key ID: FB9FDAB6B6F3418D

View file

@ -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;