-
Notifications
You must be signed in to change notification settings - Fork 0
/
bookstack_caddyfile
45 lines (40 loc) · 1.82 KB
/
bookstack_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
# https://caddyserver.com/docs/caddyfile
# https://caddyserver.com/docs/caddyfile/options#global-options
{
http_port {$HTTP_PORT:80}
https_port {$HTTPS_PORT:443}
ocsp_stapling {$OCSP_STAPLING:off}
}
{$DOMAIN:localhost} {
# https://caddyserver.com/docs/caddyfile/directives/root
root * /var/www/bookstack/public
# https://caddyserver.com/docs/caddyfile/directives/header
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control
header /upload/* Cache-Control {$CACHE_UPLOAD:"no-cache, public, must-revalidate, proxy-revalidate, max-age=315360000"}
# Following headers are only set if they don't exist
@cachedFiles {
path *.js *.svg *.css *.woff *.eot *.ttf *.png *.gif *.ico *.jpeg *.jpg *.webp *.woff2
}
header @cachedFiles ?Cache-Control {$CACHE_FILES:"no-cache, public, must-revalidate, proxy-revalidate, max-age=315360000"}
header {
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Strict-Transport-Security
?Strict-Transport-Security {$HEADER_HSTS:"max-age=31536000"}
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Content-Type-Options
?X-Content-Type-Options {$HEADER_CONTENT_TYPE:"nosniff"}
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options
?X-Frame-Options {$HEADER_FRAME_OPTIONS:"SAMEORIGIN"}
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy
?Referrer-Policy {$HEADER_REFERRER_POLICY:"strict-origin-when-cross-origin"}
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-XSS-Protection
?X-Xss-Protection {$HEADER_XSS_PROTECTION:"1; mode=block"}
}
# https://caddyserver.com/docs/caddyfile/directives/encode
encode {
zstd
gzip 6
}
# https://caddyserver.com/docs/caddyfile/directives/php_fastcgi
php_fastcgi bookstack:9000
# https://caddyserver.com/docs/caddyfile/directives/file_server
file_server
}