Files
pivoine.art/nginx.conf
Sebastian Krüger 133046eebe feat: add custom 404 error page
- Create stylish 404 page with glitch animation and CRT scanline effects
- Update nginx to serve custom 404 instead of falling back to index.html
- Page inherits site layout with WebGL background and audio player

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 19:55:17 +01:00

52 lines
1.4 KiB
Nginx Configuration File

server {
listen 80;
server_name _;
root /usr/share/nginx/html;
index index.html;
# Gzip compression
gzip on;
gzip_vary on;
gzip_min_length 1024;
gzip_types text/plain text/css text/xml text/javascript application/javascript application/xml application/json application/rss+xml image/svg+xml;
# Security headers
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-Content-Type-Options "nosniff" always;
add_header X-XSS-Protection "1; mode=block" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
# Static assets with long cache
location ~* \.(css|js|jpg|jpeg|png|gif|ico|svg|woff|woff2|ttf|eot|webp|mp3|mp4|webm|ogg)$ {
expires 1y;
add_header Cache-Control "public, immutable";
access_log off;
}
# HTML files - no cache for fresh content
location ~* \.html$ {
expires -1;
add_header Cache-Control "no-store, no-cache, must-revalidate";
}
# Custom 404 page
error_page 404 /404.html;
# Clean URLs - try files, then directories, then 404
location / {
try_files $uri $uri/ $uri.html =404;
}
# RSS feed
location = /index.xml {
types { application/rss+xml xml; }
}
# Deny access to hidden files
location ~ /\. {
deny all;
access_log off;
log_not_found off;
}
}