blob: 9a64dffc0372c0f77639afc1f249867c8adc19a0 (
plain) (
blame)
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
|
# vim: noet ts=2 sw=2
{
admin off
auto_https off
http_port {$CADDY_HTTP_PORT:1414}
}
http:// {
encode zstd gzip
handle /healthz {
respond OK 200
}
handle_errors {
@404 expression {http.error.status_code} == 404
rewrite @404 /site/404.html
file_server
}
@valid_paths {
import Caddyfile.valid_paths
}
handle @valid_paths {
root .
try_files {path} {path}/index.html {path}.html =404
file_server
}
# catch all
respond 404
log {
format filter {
wrap console {
time_format wall_milli
level_format color
}
fields {
common_log delete
request>headers>Accept-Encoding delete
request>headers>Accept-Language delete
request>headers>Connection delete
request>headers>Authorization delete
request>remote_addr ip_mask {
ipv4 24
ipv6 32
}
}
}
}
}
|