-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathCaddyfile
More file actions
45 lines (37 loc) · 1.05 KB
/
Caddyfile
File metadata and controls
45 lines (37 loc) · 1.05 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
:80 {
# Activer la compression automatique
encode gzip zstd
# Répertoire racine contenant les fichiers statiques
root * /srv
# Configuration SPA : try_files tente de servir le fichier,
# sinon redirige vers index.html pour le routing côté client
try_files {path} /index.html
# Servir les fichiers statiques
file_server
# Headers de sécurité
header {
# Empêcher le clickjacking
X-Frame-Options "SAMEORIGIN"
# Empêcher le sniffing MIME
X-Content-Type-Options "nosniff"
# Activer le filtre XSS
X-XSS-Protection "1; mode=block"
# Politique de référent stricte
Referrer-Policy "strict-origin-when-cross-origin"
}
# Cache pour les assets statiques (JS, CSS, images)
@static {
path *.js *.css *.png *.jpg *.jpeg *.gif *.svg *.ico *.woff *.woff2 *.ttf *.eot
}
header @static Cache-Control "public, max-age=31536000, immutable"
# Pas de cache pour index.html pour forcer le rechargement
@html {
path *.html
}
header @html Cache-Control "no-cache, no-store, must-revalidate"
# Logs
log {
output stdout
format console
}
}