Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,22 @@ server {
ssl_prefer_server_ciphers on;
ssl_ciphers 'ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256';

# 1. 메인 페이지 요청 (프론트엔드 보여주기)
location / {
root /usr/share/nginx/html; # 리액트 빌드 파일이 위치할 곳
index index.html index.htm;
try_files $uri $uri/ /index.html; # 새로고침 시 404 에러 방지 (필수!)
}

# 2. /api 로 시작하는 요청 (백엔드로 프록시)
location /api {
# 백엔드 컨테이너 이름 'coanalysis-app'으로 연결
proxy_pass http://coanalysis-app:8080;

# 실제 사용자의 IP 등의 정보를 백엔드에 그대로 전달하기 위한 설정
# 1. /coinsight로 시작하는 모든 요청 → 백엔드(8080)로 프록시
# /coinsight 프리픽스는 제거하고 나머지 경로만 백엔드로 전달
# 예: /coinsight/api/v1/test → http://backend:8080/api/v1/test
# 예: /coinsight/swagger-ui/index.html → http://backend:8080/swagger-ui/index.html
location /coinsight/ {
proxy_pass http://coanalysis-app:8080/;
proxy_set_header Host $host;
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;
}

# 2. 그 외 모든 요청 → 프론트엔드(React)
location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri/ /index.html;
}
}
Loading