-
Notifications
You must be signed in to change notification settings - Fork 243
/
nginx.conf
153 lines (138 loc) · 3.58 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
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# nginx configuration for tar1090
location /INSTANCE/data/ {
alias SOURCE_DIR/;
gzip_static off;
location ~ aircraft\.json$ {
add_header Cache-Control "public, no-cache";
gzip on;
gzip_static on;
}
location /INSTANCE/data/traces/ {
location ~ trace_recent {
gzip off;
add_header Cache-Control "public, no-cache";
add_header Content-Encoding "gzip";
}
location ~ trace_full {
gzip off;
add_header Cache-Control "public, no-cache";
add_header Content-Encoding "gzip";
}
}
location ~ globe_.*\.json$ {
gzip off;
add_header Cache-Control "public, no-cache";
add_header Content-Encoding "gzip";
}
location ~ .*\.binCraft$ {
gzip off;
add_header Cache-Control "public, no-cache";
add_header Content-Encoding "gzip";
}
location ~ .*\.zst$ {
gzip off;
add_header Cache-Control "public, no-cache";
}
}
location /INSTANCE/osm_tiles_offline/ {
alias /usr/local/share/osm_tiles_offline/;
}
location /INSTANCE/globe_history/ {
alias /var/globe_history/;
gzip on;
gzip_static off;
location ~ /acas/ {
default_type text/plain;
add_header Cache-Control "public, no-cache";
gzip_static on;
}
location ~ ....-..-.. {
absolute_redirect off;
rewrite "^(.*)/globe_history/(....)-(..)-(..)/(.*)$" "$1/globe_history/$2/$3/$4/$5" last;
}
location ~ traces/ {
gzip off;
add_header Cache-Control "public, max-age=1209600";
add_header Content-Encoding "gzip";
}
location ~ heatmap/ {
gzip off;
add_header Cache-Control "public, max-age=1209600";
add_header Content-Encoding "gzip";
}
}
location /INSTANCE/chunks/ {
alias /run/SERVICE/;
gzip_static off;
location ~ chunk_.*\.gz$ {
gzip off;
add_header Cache-Control "public, max-age=86400";
add_header Content-Type "application/json";
add_header Content-Encoding "gzip";
}
location ~ current_.*\.gz$ {
gzip off;
add_header Cache-Control "no-cache";
add_header Content-Type "application/json";
add_header Content-Encoding "gzip";
}
location ~ .*\.json$ {
gzip on;
add_header Cache-Control "public, no-cache";
}
}
location /INSTANCE/aircraft_sil/ {
alias /usr/local/share/tar1090/aircraft_sil/;
add_header Cache-Control "public, max-age=1209600";
try_files $uri /aircraft_sil/ZZZZ.png;
absolute_redirect off;
}
location /INSTANCE {
alias HTMLPATH/;
try_files $uri $uri/ =404;
absolute_redirect off;
gzip off;
gzip_static off;
# location block priority:
# = / exact location matches > regex matches > prefix matchs
# exact matches
location = /INSTANCE/config.js {
add_header Cache-Control "public, no-cache";
gzip on;
gzip_static on;
}
location = /INSTANCE/index.html {
add_header Cache-Control "public, no-cache";
gzip on;
gzip_static on;
}
# regex matches
location ~ ^/INSTANCE/style.*\.css$ {
add_header Cache-Control "public, max-age=7776000";
gzip on;
gzip_static on;
}
location ~ ^/INSTANCE/db-.*\.js$ {
gzip off;
gzip_static off;
add_header Cache-Control "public, max-age=7776000";
add_header Content-Encoding "gzip";
}
location ~ ^/INSTANCE/libs/.*$ {
add_header Cache-Control "public, max-age=7776000";
gzip on;
gzip_static on;
}
location ~ ^/INSTANCE/[^/]*\.js$ {
add_header Cache-Control "public, max-age=7776000";
gzip on;
gzip_static on;
}
# prefix matches
location /INSTANCE/images {
add_header Cache-Control "public, max-age=7776000";
}
location /INSTANCE/flags {
add_header Cache-Control "public, max-age=7776000";
}
}