-
Notifications
You must be signed in to change notification settings - Fork 6
/
nginx.conf
43 lines (41 loc) · 1.08 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
41
42
43
upstream django_server {
server backend_prod:8001 fail_timeout=0;
}
server {
listen 8080;
client_max_body_size 4G;
server_name 127.0.0.1;
keepalive_timeout 5;
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
if (!-f $request_filename) {
proxy_pass http://django_server;
break;
}
}
location /static {
root /backend;
}
}
server {
listen 80;
client_max_body_size 4G;
server_name 127.0.0.1;
keepalive_timeout 5;
root /frontend;
index index.html;
location / {
try_files $uri $uri/ /index.html;
}
location ~ ^/(api|admin|docs|rest-auth|refresh-token|obtain-token|remove-token|backend_static|rest-auth/registration) {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
if (!-f $request_filename) {
proxy_pass http://django_server;
break;
}
}
}