From 9560b64a6ca28daf1be7771eaba71eae2a2cd699 Mon Sep 17 00:00:00 2001 From: Nilstrieb <48135649+Nilstrieb@users.noreply.github.com> Date: Sat, 3 Sep 2022 16:36:54 +0200 Subject: [PATCH] huh --- nginx/nginx.conf | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/nginx/nginx.conf b/nginx/nginx.conf index 4962208..0fffcf7 100644 --- a/nginx/nginx.conf +++ b/nginx/nginx.conf @@ -51,21 +51,25 @@ http { server_name "api.cors-school.nilstrieb.dev"; location / { - add_header 'Access-Control-Allow-Origin' 'https://cors-school.nilstrieb.dev'; - add_header 'Access-Control-Allow-Credentials' 'true'; - add_header 'Access-Control-Allow-Methods' 'GET, POST, DELETE, PUT, OPTIONS'; - add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,token,refresh-token,Authorization'; - if ($request_method = 'OPTIONS') { + add_header 'Access-Control-Allow-Origin' 'https://cors-school.nilstrieb.dev'; + add_header 'Access-Control-Allow-Credentials' 'true'; + add_header 'Access-Control-Allow-Methods' 'GET, POST, DELETE, PUT, OPTIONS'; + add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,token,refresh-token,Authorization'; add_header 'Content-Type' 'text/plain charset=UTF-8'; add_header 'Content-Length' 0; return 204; } + add_header 'Access-Control-Allow-Origin' 'https://cors-school.nilstrieb.dev'; + add_header 'Access-Control-Allow-Credentials' 'true'; + add_header 'Access-Control-Allow-Methods' 'GET, POST, DELETE, PUT, OPTIONS'; + add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,token,refresh-token,Authorization'; + + proxy_pass http://cors-school-backend:8080/; } } - server_tokens off; } \ No newline at end of file