forked from mathesar-foundation/mathesar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Caddyfile
44 lines (43 loc) · 1.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
{$DOMAIN_NAME} {
log {
output stdout
}
respond /caddy-health-check 200
encode zstd gzip
handle_path /media/* {
@downloads {
query dl=*
}
header @downloads Content-disposition "attachment; filename={query.dl}"
file_server {
precompressed br zstd gzip
root {$MEDIA_ROOT:/mathesar/media/}
}
}
handle_path /static/* {
file_server {
precompressed br zstd gzip
root {$STATIC_ROOT:/mathesar/static/}
}
}
# Rewrite and reverse proxy upgrade endpoint calls to Watchtower;
# Accepts only POST requests, rewrites them to GET.
@upgrade_request {
path /api/ui/v0/upgrade/
method POST
}
handle @upgrade_request {
rewrite * /v1/update
method * GET
reverse_proxy watchtower:8080 {
header_up Authorization "Bearer mytoken"
transport http {
# We want keepalive connections to stay open as long as a dockerhub pull
# might take, because Watchtower responds to the upgrade request only when
# it's finished upgrading.
keepalive 0.5h
}
}
}
reverse_proxy mathesar_service:8000
}