-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCaddyfile
136 lines (107 loc) · 2.26 KB
/
Caddyfile
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
{
email {$CADDY_MAIL}
admin off
log {
format console
}
}
(cors) {
@origin header Origin *
header @origin Access-Control-Allow-Origin "https://feed.martpaul.de" # change is needed here easy fix is just "*"
#header @origin Access-Control-Allow-Methods "POST,HEAD,GET,OPTIONS"
#header @origin Access-Control-Allow-Credentials true
}
(compression) {
encode zstd gzip
}
(longcache) {
header Cache-Control "public, max-age=7776000"
}
(acarflow) {
reverse_proxy 127.0.0.1:21001
}
(acarflowws) {
handle /hub/AcarsHub {
import acarflow
}
}
(tar1090) {
redir /tar1090 /tar1090/
handle_path /tar1090* {
root * /html
file_server
encode * zstd gzip
header ?Cache-Control "public, max-age=3600, must-revalidate"
# exact matches
handle /index.html {
header Cache-Control "public, no-cache"
}
handle /config.js {
header Cache-Control "public, no-cache"
}
# regex matches
handle /images/* {
import longcache
}
handle /flags-tiny/* {
import longcache
}
handle /db-*/*.js {
import longcache
header Content-Encoding "gzip"
}
handle /libs/* {
import longcache
}
handle /style.css {
import longcache
}
}
handle_path /tar1090/data* {
root * /run/readsb
file_server
header Cache-Control "public, no-cache"
}
handle_path /tar1090/chunks* {
root * /run/tar1090
file_server
handle /chunk_*.gz {
header Cache-Control "public, max-age=86400"
header Content-Type "application/json"
header Content-Encoding "gzip"
}
handle /current_*.gz {
header Cache-Control "must-revalidate"
header Content-Type "application/json"
header Content-Encoding "gzip"
}
handle /*.json {
header Cache-Control "public, no-cache"
}
}
handle_path /tar1090/globe_history* {
root * /var/globe_history
file_server
import longcache
}
handle_path /tar1090/aircraft_sil* {
root * /usr/local/share/tar1090/aircraft_sil
file_server
import longcache
}
handle_path /readsb* {
root * /run/readsb
file_server * browse
}
# Not Used
#handle_path /tar1090/osm_tiles_offline/* {
# root * /usr/local/share/osm_tiles_offline
# file_server
#}
}
# a domain and a local ip or vpn idk
{$DOMAIN:localhost}, http://192.168.168.3 {
import tar1090
reverse_proxy 127.0.0.1:21001
import compression
}