Skip to content

Commit

Permalink
chore: nginx 설정 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
SeungGwan123 committed Nov 15, 2024
1 parent 3072799 commit 03243ff
Showing 1 changed file with 37 additions and 1 deletion.
38 changes: 37 additions & 1 deletion nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,43 @@ http {
}

# server 서비스로 프록시 (API 요청을 server로 전달)
location @api {
location /upbit {
proxy_pass http://server:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;

# CORS 설정 추가
add_header 'Access-Control-Allow-Origin' 'https://www.corinee.site' always;
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always;
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Authorization' always;
add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range' always;
}

location /trade {
proxy_pass http://server:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;

# CORS 설정 추가
add_header 'Access-Control-Allow-Origin' 'https://www.corinee.site' always;
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always;
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Authorization' always;
add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range' always;
}

location /market {
proxy_pass http://server:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
Expand Down

0 comments on commit 03243ff

Please sign in to comment.