From 8d534bcd93c3b881c2556658f572f6ae88774949 Mon Sep 17 00:00:00 2001 From: vlw Date: Mon, 17 Mar 2025 11:14:10 +0100 Subject: [PATCH] fix: add CORS headers to vlw API (#6) Reviewed-on: https://git.vlw.se/config/nginx/pulls/6 Co-authored-by: vlw Co-committed-by: vlw --- sites-available/8001-vlw-api.conf | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sites-available/8001-vlw-api.conf b/sites-available/8001-vlw-api.conf index 1fd1967..b41a10f 100644 --- a/sites-available/8001-vlw-api.conf +++ b/sites-available/8001-vlw-api.conf @@ -6,6 +6,11 @@ server { include snippets/vlw.se-ssl; location / { + add_header 'Access-Control-Allow-Origin' $http_origin; + add_header 'Access-Control-Allow-Credentials' 'true'; + add_header 'Access-Control-Allow-Methods' 'GET, POST, PATCH, PUT, OPTIONS'; + add_header 'Access-Control-Allow-Headers' 'Authorization, Origin, Content-Type, Accept'; + proxy_pass http://localhost:8001; } -} +} \ No newline at end of file