forked from harvard-edge/cs249r_book
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnetlify.toml
More file actions
81 lines (69 loc) · 2.27 KB
/
netlify.toml
File metadata and controls
81 lines (69 loc) · 2.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
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
72
73
74
75
76
77
78
79
80
81
# =============================================================================
# NETLIFY PROXY CONFIGURATION FOR GITHUB PAGES
# =============================================================================
# This configuration proxies all requests to GitHub Pages while adding
# Netlify features like custom redirects, headers, and better performance.
#
# Flow: mlsysbook.ai → Netlify → GitHub Pages
# =============================================================================
# Custom redirects (processed BEFORE proxy)
# Note: /kits/ and /labs/ now point to the standalone kits site
[[redirects]]
from = "/labs"
to = "/kits/"
status = 301
[[redirects]]
from = "/labs/"
to = "/kits/"
status = 301
[[redirects]]
from = "/pdf"
to = "https://harvard-edge.github.io/cs249r_book/assets/downloads/Machine-Learning-Systems.pdf"
status = 301
[[redirects]]
from = "/pdf/"
to = "https://harvard-edge.github.io/cs249r_book/assets/downloads/Machine-Learning-Systems.pdf"
status = 301
[[redirects]]
from = "/epub"
to = "https://harvard-edge.github.io/cs249r_book/assets/downloads/Machine-Learning-Systems.epub"
status = 301
[[redirects]]
from = "/epub/"
to = "https://harvard-edge.github.io/cs249r_book/assets/downloads/Machine-Learning-Systems.epub"
status = 301
[[redirects]]
from = "/changelog"
to = "/contents/frontmatter/changelog/changelog.html"
status = 301
[[redirects]]
from = "/changelog/"
to = "/contents/frontmatter/changelog/changelog.html"
status = 301
# Redirect all other requests to GitHub Pages (no proxying = no bandwidth cost!)
[[redirects]]
from = "/*"
to = "https://harvard-edge.github.io/cs249r_book/:splat"
status = 301
force = true
# Security and performance headers
[[headers]]
for = "/*"
[headers.values]
X-Frame-Options = "DENY"
X-XSS-Protection = "1; mode=block"
X-Content-Type-Options = "nosniff"
Referrer-Policy = "strict-origin-when-cross-origin"
Cache-Control = "no-cache, no-store, must-revalidate"
Pragma = "no-cache"
Expires = "0"
[[headers]]
for = "*.pdf"
[headers.values]
Content-Type = "application/pdf"
Cache-Control = "public, max-age=86400"
[[headers]]
for = "*.epub"
[headers.values]
Content-Type = "application/epub+zip"
Cache-Control = "public, max-age=86400"