Skip to content

Commit

Permalink
infra: cors origin 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
Hoya324 committed Nov 18, 2024
1 parent 8831532 commit d3977b7
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions nginx/conf.d/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,12 @@ server {
}

# 모든 요청에 대해 CORS 헤더 추가
add_header 'Access-Control-Allow-Origin' "$http_origin" always;
add_header 'Access-Control-Allow-Methods' 'GET, PUT, POST, DELETE, PATCH, OPTIONS' always;
add_header 'Access-Control-Allow-Headers' 'Content-Type, Authorization' always;
add_header 'Access-Control-Allow-Credentials' 'true' always;
if ($http_origin ~* (https?://(localhost:5173|api\.findynow\.com|findynow\.com))) {
add_header 'Access-Control-Allow-Origin' "$http_origin" always;
add_header 'Access-Control-Allow-Methods' 'GET, PUT, POST, DELETE, PATCH, OPTIONS' always;
add_header 'Access-Control-Allow-Headers' 'Content-Type, Authorization' always;
add_header 'Access-Control-Allow-Credentials' 'true' always;
}

# Spring 애플리케이션으로 프록시
proxy_pass http://findy-app:8080;
Expand Down

0 comments on commit d3977b7

Please sign in to comment.