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 +}