26 lines
785 B
Nginx Configuration File
26 lines
785 B
Nginx Configuration File
server {
|
|
listen 80;
|
|
server_name localhost;
|
|
root /usr/share/nginx/html;
|
|
index index.html;
|
|
|
|
# Important pour les Single Page Applications (React Router)
|
|
# Si le fichier n'existe pas, on redirige vers index.html
|
|
location / {
|
|
try_files $uri $uri/ /index.html;
|
|
}
|
|
|
|
# Mise en cache agressive pour les assets statiques
|
|
location ~* \.(?:ico|css|js|gif|jpe?g|png|woff2?|eot|ttf|svg|webp)$ {
|
|
expires 6M;
|
|
access_log off;
|
|
add_header Cache-Control "public, max-age=15552000, immutable";
|
|
}
|
|
|
|
# Ne pas mettre en cache le service worker pour que la PWA se mette à jour
|
|
location = /sw.js {
|
|
expires -1;
|
|
add_header Cache-Control "no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0";
|
|
}
|
|
}
|