-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCaddyfile
More file actions
45 lines (39 loc) · 738 Bytes
/
Caddyfile
File metadata and controls
45 lines (39 loc) · 738 Bytes
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
{
debug
}
(gzip) {
encode gzip
}
(hsts) {
header {
Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
}
}
(handle_static) {
@cachedFiles {
path *.jpg *.jpeg *.png *.gif *.ico *.svg
}
@resFiles {
path *.css
}
header @cachedFiles Cache-Control "public, max-age=604800, must-revalidate"
header @resFiles Cache-Control "public, max-age=86400, must-revalidate"
}
(handle_errors) {
handle_errors {
root * /var/www/html
rewrite * /index.html
@404 {
expression {http.error.status_code} == 404
}
rewrite @404 /404.html
file_server
}
}
http:// {
root * /var/www/html
file_server
import handle_errors
import gzip
import handle_static
}