-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnginx.conf
42 lines (34 loc) · 970 Bytes
/
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
41
42
upstream frontend_server {
server frontend:3000;
}
upstream backend_server {
server backend:8000;
}
server {
listen 80;
server_name 0.0.0.0;
root /usr/share/nginx/html;
include /etc/nginx/mime.types;
server_tokens off;
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;
location / {
proxy_pass http://frontend_server;
}
location /api/ {
proxy_pass http://backend_server/api/;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_redirect off;
proxy_connect_timeout 70s;
proxy_send_timeout 86400;
proxy_read_timeout 86400;
send_timeout 86400;
}
location ^~ /static/ {
proxy_pass http://backend_server/static/;
}
}