Skip to content

Commit c583b64

Browse files
committed
add cors
1 parent 3c3f6f3 commit c583b64

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/generateNginxConfig.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@ server {
1414
proxy_set_header Upgrade $http_upgrade;
1515
proxy_set_header Connection "upgrade";
1616
proxy_set_header X-Proxy-Server "${portConfig.gateway}";
17+
18+
add_header 'Access-Control-Allow-Origin' '*' always;
19+
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, PUT, DELETE' always;
20+
add_header 'Access-Control-Allow-Headers' 'Origin, X-Requested-With, Content-Type, Accept, Authorization' always;
21+
22+
if ($request_method = OPTIONS) {
23+
return 204;
24+
}
1725
}
1826
`;
1927

0 commit comments

Comments
 (0)