31 lines
844 B
Nginx Configuration File
31 lines
844 B
Nginx Configuration File
|
|
server {
|
||
|
|
listen 80;
|
||
|
|
server_name _;
|
||
|
|
root /usr/share/nginx/html;
|
||
|
|
index index.html;
|
||
|
|
|
||
|
|
gzip on;
|
||
|
|
gzip_types text/css application/javascript application/json image/svg+xml;
|
||
|
|
gzip_min_length 1024;
|
||
|
|
|
||
|
|
# Hashed JS/CSS bundles never change
|
||
|
|
location /assets/ {
|
||
|
|
add_header Cache-Control "public, max-age=31536000, immutable";
|
||
|
|
}
|
||
|
|
|
||
|
|
# Fly-through frames, photos and clips: cache for a week (re-run make-frames to change them)
|
||
|
|
location ~ ^/(frames|img|video)/ {
|
||
|
|
add_header Cache-Control "public, max-age=604800";
|
||
|
|
}
|
||
|
|
|
||
|
|
# The frame list must stay fresh so new footage shows up after a redeploy
|
||
|
|
location = /frames/manifest.json {
|
||
|
|
add_header Cache-Control "no-cache";
|
||
|
|
}
|
||
|
|
|
||
|
|
location / {
|
||
|
|
try_files $uri $uri/ /index.html;
|
||
|
|
add_header Cache-Control "no-cache";
|
||
|
|
}
|
||
|
|
}
|