29 lines
656 B
Nginx Configuration File
29 lines
656 B
Nginx Configuration File
|
|
server {
|
||
|
|
listen 80;
|
||
|
|
server_name _;
|
||
|
|
|
||
|
|
# Static SPA — vite build output lives here.
|
||
|
|
root /usr/share/nginx/html;
|
||
|
|
index index.html;
|
||
|
|
|
||
|
|
# Long-cache hashed assets produced by vite's rollup chunks.
|
||
|
|
location /assets/ {
|
||
|
|
access_log off;
|
||
|
|
expires 1y;
|
||
|
|
add_header Cache-Control "public, max-age=31536000, immutable";
|
||
|
|
try_files $uri =404;
|
||
|
|
}
|
||
|
|
|
||
|
|
# SPA fallback — every other path yields index.html so client-side
|
||
|
|
# react-router can take over (see src/App.tsx / <Routes>).
|
||
|
|
location / {
|
||
|
|
try_files $uri $uri/ /index.html;
|
||
|
|
}
|
||
|
|
|
||
|
|
# Defensive: no sourcemap exposure in sandbox.
|
||
|
|
location ~ \.map$ {
|
||
|
|
deny all;
|
||
|
|
return 404;
|
||
|
|
}
|
||
|
|
}
|