chore: update nginx docker compose
This commit is contained in:
@@ -67,12 +67,68 @@ server {
|
||||
add_header Pragma "no-cache" always;
|
||||
add_header Expires "0" always;
|
||||
}
|
||||
location /uploads/ {
|
||||
# ✅ IMPORTANT : alias doit se terminer par / ET le chemin aussi
|
||||
alias /usr/share/nginx/html/uploads/;
|
||||
|
||||
location ~* \.(css|js|jpg|jpeg|png|gif|svg|ico|woff2?|ttf|eot)$ {
|
||||
expires 1y;
|
||||
# ✅ Désactiver ModSecurity pour les uploads
|
||||
modsecurity off;
|
||||
|
||||
# Cache headers
|
||||
expires 30d;
|
||||
add_header Cache-Control "public, immutable";
|
||||
access_log off;
|
||||
}
|
||||
location ^~ /uploads/images/ {
|
||||
alias /usr/share/nginx/html/uploads/images/;
|
||||
|
||||
# ✅ Désactiver ModSecurity
|
||||
modsecurity off;
|
||||
|
||||
# ✅ CORS pour images publiques
|
||||
add_header Access-Control-Allow-Origin "*" always;
|
||||
add_header Access-Control-Allow-Methods "GET, HEAD, OPTIONS" always;
|
||||
|
||||
# Cache agressif
|
||||
expires 30d;
|
||||
add_header Cache-Control "public, immutable" always;
|
||||
|
||||
# Types MIME
|
||||
types {
|
||||
image/jpeg jpg jpeg;
|
||||
image/png png;
|
||||
image/gif gif;
|
||||
image/webp webp;
|
||||
image/svg+xml svg;
|
||||
}
|
||||
default_type image/jpeg;
|
||||
}
|
||||
|
||||
# =========================================================
|
||||
# ✅ UPLOADS VIDEOS (priorité maximale avec ^~)
|
||||
# =========================================================
|
||||
location ^~ /uploads/videos/ {
|
||||
alias /usr/share/nginx/html/uploads/videos/;
|
||||
|
||||
# ✅ Désactiver ModSecurity
|
||||
modsecurity off;
|
||||
|
||||
# ✅ CORS pour vidéos publiques
|
||||
add_header Access-Control-Allow-Origin "*" always;
|
||||
add_header Access-Control-Allow-Methods "GET, HEAD, OPTIONS" always;
|
||||
|
||||
# Cache agressif
|
||||
expires 30d;
|
||||
add_header Cache-Control "public, immutable" always;
|
||||
|
||||
# Types MIME pour vidéos
|
||||
types {
|
||||
video/mp4 mp4;
|
||||
video/webm webm;
|
||||
video/ogg ogv;
|
||||
}
|
||||
default_type video/mp4;
|
||||
}
|
||||
|
||||
|
||||
add_header X-Frame-Options "SAMEORIGIN" always;
|
||||
add_header X-Content-Type-Options "nosniff" always;
|
||||
|
||||
Reference in New Issue
Block a user