Files
bherbruck ff5d96aaad Docker: accept trunk's shorter content hashes (#2734)
Trunk formats the content hash without leading zeros, so it is sometimes 15 hex characters. The immutable-cache rule and the smoke test's wasm match now accept 8 to 16.

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-18 18:10:43 -04:00

34 lines
1.1 KiB
Nginx Configuration File

# The SolidCraft web app (packaging/docker/Dockerfile).
#
# Caching follows the app's update check (xtask/src/web_offline.rs): index.html, sw.js and
# build.json must always be asked for again, or browsers keep an old build; Trunk's hashed
# files (filehash = true) never change and are kept for a year.
server {
listen 8080;
server_name _;
server_tokens off;
root /srv/solidcraft;
index index.html;
gzip on;
gzip_min_length 1024;
gzip_types application/wasm application/javascript text/css application/json application/manifest+json image/svg+xml font/ttf;
location / {
try_files $uri $uri/ =404;
add_header Cache-Control "no-cache" always;
add_header X-Content-Type-Options "nosniff" always;
}
location ~ "-[0-9a-f]{8,16}(_bg)?\.(js|wasm|css)$" {
add_header Cache-Control "public, max-age=31536000, immutable" always;
add_header X-Content-Type-Options "nosniff" always;
}
location ~ \.webmanifest$ {
default_type application/manifest+json;
add_header Cache-Control "no-cache" always;
add_header X-Content-Type-Options "nosniff" always;
}
}