From 58e0b7aedb0135564f80c7fa6097d068af2b1068 Mon Sep 17 00:00:00 2001 From: tlsaudwl Date: Mon, 10 Jun 2024 19:19:38 +0900 Subject: [PATCH] =?UTF-8?q?nginx.conf=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nginx.conf | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/nginx.conf b/nginx.conf index ef5cc5d..99e2a57 100644 --- a/nginx.conf +++ b/nginx.conf @@ -17,6 +17,16 @@ http { root /usr/share/nginx/html; index index.html index.htm; try_files $uri $uri/ /index.html; + + # CORS 설정 추가 + add_header 'Access-Control-Allow-Origin' '*'; + add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, PUT, DELETE'; + add_header 'Access-Control-Allow-Headers' 'Origin, Content-Type, Accept, Authorization'; + add_header 'Access-Control-Allow-Credentials' 'true'; + + if ($request_method = 'OPTIONS') { + return 204; + } } error_page 500 502 503 504 /50x.html; @@ -24,4 +34,4 @@ http { root /usr/share/nginx/html; } } -} \ No newline at end of file +}