Files
solidcraft-upstream/packaging/docker/nginx.conf
T

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]{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;
}
}