-
Notifications
You must be signed in to change notification settings - Fork 10
/
Caddyfile
56 lines (44 loc) · 1.05 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
# Unless the file starts with a global options block, the first
# uncommented line is always the address of your site.
:80 {
log {
output stdout
}
@prod {
expression {env.PROD} == "true"
}
handle @prod {
respond /robots.txt 404
}
handle {
respond /robots.txt 200 {
body <<ROBOTS_TXT
User-agent: *
Disallow: /
ROBOTS_TXT
close
}
}
root * /usr/share/caddy
encode gzip
map {path} {npath} {
import /usr/share/caddy/assets/deprecated-urls
import /usr/share/caddy/assets/prettyurls
}
route {
error /hashed* 404
try_files {npath}.html {path}.html {path}
}
uri /type/* replace :: /
# Enable the static file server.
file_server
handle_errors {
@404 {
expression {http.error.status_code} == 404
}
rewrite @404 /404.html
file_server
}
}
# Refer to the Caddy docs for more information:
# https://caddyserver.com/docs/caddyfile