-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCaddyfile
More file actions
35 lines (29 loc) · 1.27 KB
/
Caddyfile
File metadata and controls
35 lines (29 loc) · 1.27 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
:8043 {
root * /srv/http
file_server
# Redirect www to non-www
@www host www.dev.tools
redir @www https://dev.tools{uri} 301
# Cache static assets for 1 year
@static_assets {
path /assets/* /docs/assets/* /logo.svg
}
header @static_assets Cache-Control "public, max-age=31536000, immutable"
# Cache HTML for 1 hour with revalidation
@html {
path *.html
}
header @html Cache-Control "public, max-age=3600, must-revalidate"
# Permanent redirects for moved docs
redir /docs/guides/01-getting-started /docs/start-here/install 301
redir /docs/guides/02-importing-har-files /docs/how-to/import-har 301
redir /docs/guides/03-working-with-flows /docs/how-to/working-with-flows 301
redir /docs/guides/04-environments-and-variables /docs/how-to/environments-and-variables 301
redir /docs/guides/05-cli-tool /docs/reference/cli 301
redir /docs/guides/06-cicd-integration /docs/how-to/ci-integrations 301
redir /docs/guides/07-examples-and-best-practices /docs/cookbook/examples-and-best-practices 301
redir /docs/guides/writing-docs /docs/contributing/writing-docs 301
# Author URL migration (spaces to slugified)
redir "/blog/author/DevTools%20Team" /blog/author/devtools-team 301
redir "/blog/author/DevTools Team" /blog/author/devtools-team 301
}