-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#76]
- Loading branch information
Showing
2 changed files
with
110 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
worker_processes auto; | ||
|
||
events { | ||
worker_connections 1024; | ||
} | ||
|
||
http { | ||
include mime.types; | ||
default_type application/octet-stream; | ||
|
||
# 업스트림 서버 정의 | ||
upstream backend_servers { | ||
# 백엔드 서버 목록 (로드 밸런싱 대상 서버) | ||
server betting_duck_app_dev:3000; | ||
} | ||
|
||
server { | ||
listen 80; | ||
|
||
# 일반 API 요청 처리 | ||
location /api { | ||
proxy_pass http://backend_servers/api; | ||
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; | ||
} | ||
|
||
# Socket.IO 요청 처리 | ||
location /socket.io/ { | ||
proxy_pass http://backend_servers/socket.io/; | ||
proxy_http_version 1.1; | ||
proxy_set_header Upgrade $http_upgrade; | ||
proxy_set_header Connection $http_connection; | ||
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; | ||
|
||
# WebSocket 시간 초과 설정 | ||
proxy_read_timeout 60s; | ||
proxy_send_timeout 60s; | ||
|
||
# 버퍼 크기 설정 | ||
proxy_buffering off; | ||
} | ||
|
||
# 정적 파일 경로 설정 | ||
location / { | ||
root /static/; | ||
index index.html; | ||
autoindex off; | ||
try_files $uri /index.html; | ||
} | ||
} | ||
} |