39 lines
1.1 KiB
Nginx Configuration File
39 lines
1.1 KiB
Nginx Configuration File
server {
|
|
listen 80;
|
|
server_name _;
|
|
root /usr/share/nginx/html;
|
|
index index.html;
|
|
|
|
gzip on;
|
|
gzip_vary on;
|
|
gzip_comp_level 6;
|
|
gzip_min_length 1024;
|
|
gzip_proxied any;
|
|
gzip_types text/plain text/css application/javascript application/json
|
|
image/svg+xml;
|
|
|
|
# Hashed build assets — safe to cache forever.
|
|
location /_nuxt/ {
|
|
add_header Cache-Control "public, max-age=31536000, immutable";
|
|
try_files $uri =404;
|
|
}
|
|
|
|
# The prebaked dump is a multi-MB binary blob. It's already compact and
|
|
# gzip on 37 MB per request is not worth the CPU, so it stays out of
|
|
# gzip_types; the explicit type keeps it off nginx's text guesses.
|
|
location ~* \.pdx$ {
|
|
default_type application/octet-stream;
|
|
add_header Cache-Control "public, max-age=2592000";
|
|
try_files $uri =404;
|
|
}
|
|
|
|
# SPA: ssr is off, so every route resolves to the shell.
|
|
location / {
|
|
try_files $uri $uri/ /index.html;
|
|
}
|
|
|
|
location = /index.html {
|
|
add_header Cache-Control "no-cache";
|
|
}
|
|
}
|