-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnginx.conf
More file actions
57 lines (47 loc) · 1.54 KB
/
nginx.conf
File metadata and controls
57 lines (47 loc) · 1.54 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
# 백엔드 upstream 설정
upstream fastapi {
server fastapi:8000;
}
# 프론트엔드 upstream 설정
upstream frontend {
server frontend:3000;
}
client_body_buffer_size 4k; #클라이언트 요청의 버퍼 사이즈
#client_body_temp_path /var/nginx/client_temp;
server {
listen 80;
location /docks {
proxy_pass http://fastapi/docs;
proxy_buffers 64 4K;
proxy_request_buffering on;
}
# /api 경로로 오는 요청을 백엔드 upstream 의 /api 경로로 포워딩
location /api {
proxy_pass http://fastapi;
proxy_buffers 64 4K;
proxy_request_buffering on;
}
# / 경로로 오는 요청을 프론트엔드 upstream 의 / 경로로 포워딩
location / {
# 프록시 설정 백엔드의 응답 당담.
proxy_pass http://frontend/;
}
}
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
keepalive_timeout 65;
include /etc/nginx/conf.d/*.conf;
}