# ===================================================================== # Nginx — sauvermonentreprise.fr (exemple à adapter) # Copier vers /etc/nginx/sites-available/sauvermonentreprise # puis : ln -s ../sites-available/sauvermonentreprise sites-enabled/ # TLS : certbot --nginx -d sauvermonentreprise.fr -d www.sauvermonentreprise.fr # ===================================================================== server { listen 80; server_name sauvermonentreprise.fr www.sauvermonentreprise.fr; root /var/www/sauvermonentreprise/public; index index.php; charset utf-8; client_max_body_size 20M; # En-têtes de sécurité de base (CSP complète à affiner en Phase 2) add_header X-Frame-Options "SAMEORIGIN" always; add_header X-Content-Type-Options "nosniff" always; add_header Referrer-Policy "strict-origin-when-cross-origin" always; location / { try_files $uri $uri/ /index.php?$query_string; } location ~ \.php$ { fastcgi_pass unix:/var/run/php/php8.4-fpm.sock; # adapter à la version fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; include fastcgi_params; } # Assets fingerprintés : cache long location ~* \.(css|js|woff2?|svg|png|jpe?g|webp|avif)$ { expires 1y; add_header Cache-Control "public, immutable"; try_files $uri =404; } location ~ /\.(?!well-known).* { deny all; } access_log /var/log/nginx/sauvermonentreprise.access.log; error_log /var/log/nginx/sauvermonentreprise.error.log; }