Skip to content

Commit

Permalink
Merge pull request #23 from UMC-E-TEAM/feature/12
Browse files Browse the repository at this point in the history
fix: cors error
  • Loading branch information
zzimnii authored Jan 2, 2024
2 parents 6f6dc9e + 552a77c commit bd24b30
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions .platform/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit bd24b30

Please sign in to comment.