-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathnginx.conf
More file actions
31 lines (26 loc) · 730 Bytes
/
Copy pathnginx.conf
File metadata and controls
31 lines (26 loc) · 730 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
server {
listen 8080;
server_name _;
# This is where we'll copy build/client into the image
root /usr/share/nginx/html;
index index.html;
# Health check (optional)
location = /healthz {
add_header Content-Type text/plain;
return 200 "ok\n";
}
# Never cache the HTML entrypoint (so deploys update quickly)
location = /index.html {
add_header Cache-Control "no-store";
}
# Cache fingerprints / bundled assets (Vite typically outputs /assets/*)
location /assets/ {
try_files $uri =404;
expires 1y;
add_header Cache-Control "public, immutable";
}
# Serve static files if they exist, otherwise fall back to SPA entry
location / {
try_files $uri $uri/ /index.html;
}
}