-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdefault.conf
99 lines (85 loc) · 3.18 KB
/
default.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
client_max_body_size 20M;
gzip on;
gzip_comp_level 5;
gzip_min_length 256;
gzip_proxied any;
gzip_vary on;
gzip_types
application/javascript
application/json
application/x-font-ttf
application/xml
font/opentype
image/bmp
image/svg+xml
image/x-icon
text/css
text/plain;
proxy_cache_path /var/tmp/cache levels=1:2 keys_zone=STATIC:10m inactive=24h;
server {
listen 80;
listen [::]:80;
server_name localhost;
root /usr/share/nginx/html;
client_max_body_size 50M;
if ($http_x_forwarded_proto = "http") {
return 301 https://$host$request_uri;
}
location /api {
rewrite ^/api/(.*) /api/$1 break;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Host $host;
proxy_pass http://localhost:8000;
}
location /app {
try_files /storage/apk/rtmis.apk =404;
add_header Content-Disposition 'attachment; filename="rtmis.apk"';
}
location /config.js {
rewrite ^/config.js /api/v1/config.js break;
add_header Cache-Control "max-age=1800, public";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Host $host;
proxy_ignore_headers X-Accel-Expires Expires Cache-Control Set-Cookie;
proxy_buffering on;
proxy_cache STATIC;
proxy_cache_valid 200 206 1d;
proxy_cache_valid any 60m;
proxy_cache_use_stale error timeout invalid_header updating
http_500 http_502 http_503 http_504;
proxy_pass http://localhost:8000;
}
location /static-files {
proxy_set_header Host $host;
add_header Cache-Control "max-age=1800, public";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Host $host;
proxy_ignore_headers X-Accel-Expires Expires Cache-Control Set-Cookie;
proxy_buffering on;
proxy_cache STATIC;
proxy_cache_valid 200 206 1d;
proxy_cache_valid any 60m;
proxy_cache_use_stale error timeout invalid_header updating
http_500 http_502 http_503 http_504;
proxy_pass http://localhost:8000;
}
location /images/ {
rewrite ^/images/(.*)$ /storage/images/$1 last;
expires 7d;
add_header Cache-Control "max-age=604800, public";
}
location /cronjob_results/ {
rewrite ^/cronjob_results/(.*)$ /storage/cronjob_results/$1 last;
}
location /datapoints/ {
rewrite ^/datapoints/(.*)$ /storage/datapoints/$1 last;
}
location /kenya-administration.csv {
rewrite ^/kenya-administration.csv /storage/master_data/kenya-administration.csv break;
}
location / {
try_files $uri $uri/ /index.html;
}
}