-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwrangler.toml
More file actions
71 lines (58 loc) · 1.56 KB
/
wrangler.toml
File metadata and controls
71 lines (58 loc) · 1.56 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name = "md-book"
compatibility_date = "2024-09-06"
[env.production]
name = "md-book"
[env.staging]
name = "md-book-staging"
# Pages configuration
[pages]
# Output directory from the Rust build process
pages_build_output_dir = "dist"
# Environment variables for Cloudflare Pages
[vars]
NODE_VERSION = "20"
RUST_VERSION = "1.70.0"
# Custom domains (optional - configure in Cloudflare dashboard)
# [pages.custom_domains]
# production = "your-domain.com"
# staging = "staging.your-domain.com"
# Headers for security and optimization
[[pages.headers]]
for = "/*"
[pages.headers.values]
X-Content-Type-Options = "nosniff"
X-Frame-Options = "DENY"
X-XSS-Protection = "1; mode=block"
Referrer-Policy = "strict-origin-when-cross-origin"
Permissions-Policy = "camera=(), microphone=(), geolocation=()"
# Cache control for static assets
[[pages.headers]]
for = "/css/*"
[pages.headers.values]
Cache-Control = "public, max-age=31536000, immutable"
[[pages.headers]]
for = "/js/*"
[pages.headers.values]
Cache-Control = "public, max-age=31536000, immutable"
[[pages.headers]]
for = "/img/*"
[pages.headers.values]
Cache-Control = "public, max-age=31536000, immutable"
[[pages.headers]]
for = "/pagefind/*"
[pages.headers.values]
Cache-Control = "public, max-age=3600"
# HTML files should be revalidated
[[pages.headers]]
for = "/*.html"
[pages.headers.values]
Cache-Control = "public, max-age=0, must-revalidate"
# Redirects (example)
# [[pages.redirects]]
# from = "/old-path"
# to = "/new-path"
# status = 301
# Error pages
[pages.error_pages]
"404.html" = "/404.html"
"500.html" = "/500.html"