forked from baotlake/office-website
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCaddyfile
More file actions
38 lines (32 loc) · 1.18 KB
/
Caddyfile
File metadata and controls
38 lines (32 loc) · 1.18 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
35
36
37
38
:80 {
root * /srv
# Serve static files; return a genuine 404 if the file doesn't exist
# (do NOT fall back to index.html — Next.js static export has a real
# HTML file for every route, and a fake 200 would pollute caches).
file_server
# Next.js static export writes /foo/index.html and /foo.html.
# Try both variants so clean URLs work, but stop there.
try_files {path} {path}.html {path}/index.html
# Prevent 404 (and other error) responses from being cached by
# browsers or intermediate proxies.
handle_errors {
header Cache-Control "no-store"
respond "{err.status_code} {err.status_text}" {err.status_code}
}
# Cache immutable versioned OnlyOffice assets (1 year)
@onlyoffice_versioned {
path /v*-*/*
}
header @onlyoffice_versioned Cache-Control "public, max-age=31556952, immutable"
# Brotli-encoded x2t wasm
@x2t_wasm {
path /x2t/x2t.wasm
}
header @x2t_wasm Content-Encoding br
# Brotli-encoded x2t versioned bundles
@x2t_suffix {
path /x2t-*/*
}
header @x2t_suffix Content-Encoding br
header @x2t_suffix Cache-Control "public, max-age=31556952, immutable"
}