Files
ermnvldmr.com/ci/config/nginx/default.conf
T
deytenit 9ee672504f fix: PageHead header alignment, analytics proxy, and infra improvements (#64)
🤖 Pull request created from `various-fixes` containing PageHead
breadcrumbs and navigation alignment fixes, Umami analytics proxy, and
infrastructure updates.
2026-10-24 16:52:49 +03:00

64 lines
2.0 KiB
Plaintext

server {
listen 80;
server_name localhost;
root /usr/share/nginx/html;
index index.html;
# Security Headers (Defense in depth)
add_header X-Content-Type-Options "nosniff" always;
add_header X-Frame-Options "DENY" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
add_header Cross-Origin-Opener-Policy "same-origin" always;
add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload" always;
# 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;
# Root redirect: detect browser language, fallback to /en/
location = / {
set $locale "en";
if ($http_accept_language ~* "(^|,\s*)ru") {
set $locale "ru";
}
return 302 /$locale/;
}
# Cache hashed static assets (JS, CSS, fonts) — matched before locale prefix blocks
# root is inherited from server block, so /en/static/js/file.js resolves correctly
location ~* \.(js|css|woff|woff2|ttf|eot)$ {
expires 1y;
add_header Cache-Control "public, immutable";
}
# Cache images
location ~* \.(png|jpg|jpeg|gif|ico|svg)$ {
expires 1y;
add_header Cache-Control "public, no-transform";
}
# English locale — SPA fallback for non-asset routes
location /en/ {
try_files $uri $uri/ $uri.html /en/index.html;
}
# Russian locale — SPA fallback for non-asset routes
location /ru/ {
try_files $uri $uri/ $uri.html /ru/index.html;
}
# Version probe for release rollout verification
location = /version.json {
add_header Cache-Control "no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0" always;
add_header Content-Type "application/json" always;
try_files /version.json =404;
}
# Error pages
error_page 404 /en/index.html;
}