Files
bar/nginx.conf
T
valknar b3b9fb7ac6 Initial commit — Bar Pivoine cocktail recipe site
Hugo Extended site with 426 cocktail recipes from the open cocktail dataset.
Dark amber/gold editorial aesthetic, Tailwind CSS v4, Alpine.js client-side
search and filtering, HTMX page transitions, Docker + nginx production build.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-07 11:53:45 +02:00

56 lines
1.5 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_proxied any;
gzip_comp_level 6;
gzip_types text/plain text/css text/xml application/json application/javascript application/rss+xml application/atom+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;
add_header Permissions-Policy "camera=(), microphone=(), geolocation=()" always;
# HTML — no cache (always fresh)
location ~* \.html$ {
add_header Cache-Control "no-store, no-cache, must-revalidate";
}
# Static assets — 1 year immutable
location ~* \.(css|js|webp|jpg|jpeg|png|gif|ico|svg|woff|woff2|ttf|eot|otf)$ {
expires 1y;
add_header Cache-Control "public, max-age=31536000, immutable";
access_log off;
}
# RSS/Atom feed MIME type
location ~* \.(rss|atom)$ {
types { application/rss+xml rss; application/atom+xml atom; }
}
# Clean URLs
location / {
try_files $uri $uri/ $uri.html =404;
}
# Custom 404
error_page 404 /404.html;
location = /404.html {
internal;
}
# Block hidden files
location ~ /\. {
deny all;
access_log off;
log_not_found off;
}
}