From 552a77cc6c63d85454b2f98da4e2275a6f143352 Mon Sep 17 00:00:00 2001 From: zzimnii Date: Wed, 3 Jan 2024 04:38:20 +0900 Subject: [PATCH] fix: cors error --- .platform/nginx.conf | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/.platform/nginx.conf b/.platform/nginx.conf index afd76d7..36f4660 100644 --- a/.platform/nginx.conf +++ b/.platform/nginx.conf @@ -35,23 +35,11 @@ http { listen [::]:80 default_server; location / { - if ($request_method = 'OPTIONS') { - add_header 'Access-Control-Allow-Origin' '*'; - add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS'; - add_header 'Access-Control-Allow-Headers' 'Authorization, Content-Type'; - add_header 'Access-Control-Allow-Credentials' 'true'; - - add_header 'Content-Length' 0; - add_header 'Content-Type' 'text/plain; charset=utf-8'; - return 204; - } - proxy_pass http://springboot; # CORS 관련 헤더 추가 - add_header 'Access-Control-Allow-Origin' '*'; + add_header 'Access-Control-Allow-Origin' 'http://localhost:5173'; add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS'; add_header 'Access-Control-Allow-Headers' 'Authorization, Content-Type'; - proxy_http_version 1.1; proxy_set_header Connection $connection_upgrade; proxy_set_header Upgrade $http_upgrade;