forked from boostcampwm-2024/web05-Denamu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx.conf
40 lines (36 loc) · 1.03 KB
/
nginx.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
server {
listen 80;
server_name 192.168.0.27;
# 정적 파일 서빙 - FE 빌드 파일
location / {
root /var/web05-Denamu/client/dist;
index index.html;
try_files $uri /index.html;
}
# 정적 파일 서빙
location /files {
alias /var/web05-Denamu/static/;
try_files $uri $uri/ =404;
}
# API 요청을 NestJS로 프록시
location /api {
proxy_pass http://127.0.0.1:8080;
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_read_timeout 3600s;
}
# WebSocket 요청 프록시
location /chat {
proxy_pass http://127.0.0.1:8080;
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_read_timeout 3600s;
proxy_send_timeout 3600s;
}
}