-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnginx.conf
More file actions
36 lines (31 loc) · 1019 Bytes
/
Copy pathnginx.conf
File metadata and controls
36 lines (31 loc) · 1019 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
server {
listen 80;
listen [::]:80;
server_name _;
root /usr/share/nginx/html;
index index.html;
gzip on;
gzip_comp_level 6;
gzip_min_length 1024;
gzip_types text/plain text/css application/javascript application/json application/wasm image/svg+xml;
# The Faust WASM compiler is large; serve it with the correct MIME type and
# cache it aggressively (filenames are content-hashed by Vite).
location ~* \.wasm$ {
default_type application/wasm;
expires 1y;
add_header Cache-Control "public, immutable";
}
# Hashed build assets (js/css/data/wasm) never change under the same name.
location /assets/ {
expires 1y;
add_header Cache-Control "public, immutable";
}
# index.html is the app entrypoint — always revalidate so deploys take effect.
location = /index.html {
add_header Cache-Control "no-cache";
}
# SPA fallback.
location / {
try_files $uri $uri/ /index.html;
}
}