59 lines
1.8 KiB
Nginx Configuration File
59 lines
1.8 KiB
Nginx Configuration File
# Copied to /etc/nginx/conf.d/default.conf, replacing the image's default server.
|
|
server {
|
|
listen 80;
|
|
listen [::]:80;
|
|
server_name _;
|
|
|
|
root /usr/share/nginx/html;
|
|
index index.html;
|
|
server_tokens off;
|
|
|
|
# The build emits no .gz/.br, so compress on the fly.
|
|
gzip on;
|
|
gzip_vary on;
|
|
gzip_min_length 256;
|
|
gzip_types
|
|
application/javascript
|
|
application/json
|
|
application/manifest+json
|
|
application/wasm
|
|
image/svg+xml
|
|
text/css
|
|
text/javascript
|
|
text/plain
|
|
text/xml;
|
|
|
|
# Rewritten by docker-entrypoint.sh on every container start. Exact match, so the
|
|
# _app/immutable rule below can never apply to it.
|
|
location = /config.js {
|
|
add_header Cache-Control "no-store" always;
|
|
try_files $uri =404;
|
|
}
|
|
|
|
# Content-hashed filenames: safe forever.
|
|
location /_app/immutable/ {
|
|
add_header Cache-Control "public, max-age=31536000, immutable" always;
|
|
try_files $uri =404;
|
|
}
|
|
|
|
# Deploy marker the client polls. Stale copies mean updates are never noticed.
|
|
location = /_app/version.json {
|
|
add_header Cache-Control "no-cache" always;
|
|
try_files $uri =404;
|
|
}
|
|
|
|
# The shell. Same reason as version.json: it names the current immutable bundle.
|
|
location = /index.html {
|
|
add_header Cache-Control "no-cache" always;
|
|
}
|
|
|
|
# Nothing is prerendered (+layout.ts sets ssr = false, prerender = false) and the
|
|
# adapter's fallback is index.html, so every unknown path belongs to the client
|
|
# router. Without this, /login, /games, /tournaments, /users and /statistiques 404
|
|
# on deep-link or hard refresh. The internal redirect re-enters `location =
|
|
# /index.html`, so fallback responses pick up no-cache too.
|
|
location / {
|
|
try_files $uri $uri/ /index.html;
|
|
}
|
|
}
|