-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCaddyfile
39 lines (35 loc) · 972 Bytes
/
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
{
order pmtiles_proxy before reverse_proxy
email ${MAPS_EMAIL}
}
(cors) {
@origin header Origin {args.0}
header @origin {
Access-Control-Allow-Origin "{header.Origin}"
Access-Control-Allow-Methods "GET, POST, PUT, PATCH, DELETE, OPTIONS"
Access-Control-Allow-Headers "*"
Access-Control-Allow-Credentials "true"
Access-Control-Max-Age "3600"
defer
}
}
${MAPS_DOMAIN}:${MAPS_PORT} {
@allowed_origins {
expression {header.Origin}.matches('^${MAPS_SERVE_DOMAIN}$') || {header.Origin}.matches('^https://maplibre\\.org$')
}
header @allowed_origins {
Access-Control-Allow-Origin "{header.Origin}"
Access-Control-Allow-Methods "*"
Access-Control-Allow-Headers "*"
Access-Control-Allow-Credentials "true"
Access-Control-Max-Age "3600"
defer
}
handle_path /tiles/* {
pmtiles_proxy {
bucket ${MAPS_PMTILES_LOCATION}
cache_size 19000
public_url https://${MAPS_DOMAIN}/tiles
}
}
}