34 lines
830 B
Nginx Configuration File
34 lines
830 B
Nginx Configuration File
server {
|
|
listen 80;
|
|
server_name _;
|
|
|
|
root /usr/share/nginx/html;
|
|
index index.html;
|
|
|
|
# Never emit the nginx version
|
|
server_tokens off;
|
|
|
|
# Gzip text assets
|
|
gzip on;
|
|
gzip_types text/plain text/css application/javascript application/json image/svg+xml;
|
|
gzip_min_length 1024;
|
|
|
|
# SPA fallback: /privacy, /terms and any unknown route serve index.html
|
|
location / {
|
|
try_files $uri $uri/ /index.html;
|
|
}
|
|
|
|
# Hashed build assets can be cached hard
|
|
location /assets/ {
|
|
add_header Cache-Control "public, max-age=31536000, immutable";
|
|
try_files $uri =404;
|
|
}
|
|
|
|
# Favicon and static files
|
|
location ~* \.(svg|ico|png|jpg|jpeg|webp|txt|xml|webmanifest)$ {
|
|
expires 7d;
|
|
add_header Cache-Control "public";
|
|
try_files $uri =404;
|
|
}
|
|
}
|