Add CORS header for Forgejo API via nginx (fix homepage project fetch)
This commit is contained in:
parent
9208326389
commit
c67e1a7a71
1 changed files with 9 additions and 0 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue