-
-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathCaddyfile.sample
More file actions
57 lines (50 loc) · 1.29 KB
/
Caddyfile.sample
File metadata and controls
57 lines (50 loc) · 1.29 KB
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
YOUR_FQDN_OR_HOSTNAME {
encode gzip
tls YOUR_EMAIL_ADDRESS
log {
output file /var/log/caddy.log
}
# --- Maintenance mode ---
# Toggle with `scripts/maintenance.sh on|off`, or create/delete the flag
# file ./public/maintenance/ON directly. The `file` matcher is evaluated
# per-request, so flipping it takes effect immediately — no reload needed.
# Requires the ./public/maintenance:/srv/maintenance mount on the caddy
# service (already set in docker-compose.yml).
@maintenance file {
root /srv/maintenance
try_files ON
}
route {
# When the flag is present, the maintenance page takes over every
# path and returns 503 so clients know the outage is temporary.
handle @maintenance {
root * /srv/maintenance
rewrite * /index.html
header Retry-After "3600"
header Cache-Control "no-store"
file_server {
status 503
}
}
# --- Tile API (land-cover / canopy / buildings) ---
handle_path /api/tiles/* {
rewrite * /tiles{uri}
reverse_proxy meshinfo:9000
}
handle /tiles/* {
reverse_proxy meshinfo:9000
}
# --- API ---
handle_path /api/* {
reverse_proxy meshinfo:9000
}
# --- API (direct /v1/* access, used by the SPA) ---
handle /v1/* {
reverse_proxy meshinfo:9000
}
# --- Frontend ---
handle {
reverse_proxy frontend:80
}
}
}