-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_headers
More file actions
33 lines (28 loc) · 1.02 KB
/
Copy path_headers
File metadata and controls
33 lines (28 loc) · 1.02 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
# Cloudflare Pages Configuration
# Build configuration
[build]
command = "npm run build"
publish = "dist"
# Environment variables can also be set here
# (but prefer using the Cloudflare dashboard for secrets)
[build.environment]
NODE_VERSION = "18"
# Headers for security and performance
[[headers]]
for = "/*"
[headers.values]
X-Frame-Options = "DENY"
X-Content-Type-Options = "nosniff"
X-XSS-Protection = "1; mode=block"
Referrer-Policy = "strict-origin-when-cross-origin"
# Cache static assets
[[headers]]
for = "/assets/*"
[headers.values]
Cache-Control = "public, max-age=31536000, immutable"
# SPA routing - serve index.html for all routes
[[redirects]]
from = "/*"
to = "/index.html"
status = 200
conditions = {path = "!/*.html", path = "!/*.css", path = "!/*.js", path = "!/*.json", path = "!/*.pdf", path = "!/*.png", path = "!/*.jpg", path = "!/*.jpeg", path = "!/*.gif", path = "!/*.svg", path = "!/*.ico", path = "!/*.woff", path = "!/*.woff2", path = "!/*.ttf", path = "!/*.eot"}