-
Notifications
You must be signed in to change notification settings - Fork 47
/
nginx.conf
54 lines (47 loc) · 1.78 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
44
45
46
47
48
49
50
51
52
53
54
server {
listen 8080;
listen [::]:8080;
server_name _;
client_max_body_size 4G;
# path for static files
# root /path/to/app/current/public;
# We are only proxying - not returning any files
#root /dev/null;
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $http_host;
# we don't want nginx trying to do something clever with
# redirects, we set the Host: header above already.
proxy_redirect off;
proxy_pass http://merginmaps-web;
}
# proxy to backend
# we need to disable buffering for these endpoints which use stream (up or down)
# /v1/project/download/
location ~ /v1/project/download/ {
# unfortunately, proxy settings do not support inheritance within nested locations, hence copied set up from root location
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $http_host;
# we don't want nginx trying to do something clever with
# redirects, we set the Host: header above already.
proxy_redirect off;
proxy_pass http://merginmaps-server:5000;
# disable buffering
client_max_body_size 0; # No maximum client body size
proxy_http_version 1.1; # Needed to disable client buffering
proxy_request_buffering off;
proxy_buffering off;
}
location ~ ^/(v1/|v2/|app/|ping|config) {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $http_host;
proxy_pass http://merginmaps-server:5000;
}
location /download/ {
internal;
alias /data/; # we need to mount data from mergin server here
}
}