53 lines
2.0 KiB
ApacheConf
53 lines
2.0 KiB
ApacheConf
# ============================================================================
|
|||
|
|
# gong.gp — configuration Apache (o2switch / hébergement mutualisé statique).
|
||
|
|
# Le CSP script-src/style-src est géré par la balise <meta> hachée de SvelteKit.
|
||
|
|
# ============================================================================
|
||
|
|
|
||
|
|
# ── HTTPS forcé ──
|
||
|
|
<IfModule mod_rewrite.c>
|
||
|
|
RewriteEngine On
|
||
|
|
RewriteCond %{HTTPS} off
|
||
|
|
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
|
||
|
|
</IfModule>
|
||
|
|
|
||
|
|
# ── En-têtes de sécurité ──
|
||
|
|
<IfModule mod_headers.c>
|
||
|
|
Header always set X-Frame-Options "DENY"
|
||
|
|
Header always set X-Content-Type-Options "nosniff"
|
||
|
|
Header always set Referrer-Policy "strict-origin-when-cross-origin"
|
||
|
|
Header always set Permissions-Policy "geolocation=(), camera=(), microphone=(), payment=(), usb=(), interest-cohort=()"
|
||
|
|
Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
|
||
|
|
Header always set Content-Security-Policy "frame-ancestors 'none'; base-uri 'self'; form-action 'self'; object-src 'none'"
|
||
|
|
</IfModule>
|
||
|
|
|
||
|
|
# ── Cache : assets immuables ──
|
||
|
|
<IfModule mod_headers.c>
|
||
|
|
<FilesMatch "\.(woff2|avif|webp|png|jpg|jpeg|svg|ico)$">
|
||
|
|
Header set Cache-Control "public, max-age=31536000, immutable"
|
||
|
|
</FilesMatch>
|
||
|
|
</IfModule>
|
||
|
|
<IfModule mod_expires.c>
|
||
|
|
ExpiresActive On
|
||
|
|
ExpiresByType text/css "access plus 1 year"
|
||
|
|
ExpiresByType application/javascript "access plus 1 year"
|
||
|
|
ExpiresByType font/woff2 "access plus 1 year"
|
||
|
|
ExpiresByType image/avif "access plus 1 year"
|
||
|
|
ExpiresByType image/webp "access plus 1 year"
|
||
|
|
ExpiresByType text/html "access plus 0 seconds"
|
||
|
|
</IfModule>
|
||
|
|
|
||
|
|
# ── Compression ──
|
||
|
|
<IfModule mod_deflate.c>
|
||
|
|
AddOutputFilterByType DEFLATE text/html text/css application/javascript application/json image/svg+xml application/xml
|
||
|
|
</IfModule>
|
||
|
|
|
||
|
|
# ── Page 404 autonome ──
|
||
|
|
ErrorDocument 404 /404.html
|
||
|
|
|
||
|
|
# ── Types ──
|
||
|
|
<IfModule mod_mime.c>
|
||
|
|
AddType application/manifest+json .webmanifest
|
||
|
|
AddType font/woff2 .woff2
|
||
|
|
AddType image/avif .avif
|
||
|
|
</IfModule>
|