This commit is contained in:
Mackie 2026-06-08 07:49:46 +08:00
parent 48815fca01
commit 2c39f622ce
2 changed files with 6 additions and 6 deletions

View file

@ -1,12 +1,9 @@
server {
listen 80;
# Use 'alias' to map the specific sub-path
# Redirect traffic from /lab/data-dashboard/ to your index.html
location /lab/data-dashboard/ {
alias /usr/share/nginx/html/;
try_files $uri $uri/ /index.html;
}
gzip on;
gzip_types text/css application/javascript application/json;
}

View file

@ -2,6 +2,9 @@ import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
export default defineConfig({
base: '/lab/data-dashboard/', // This tells Vite to prepend this to all paths
base: '/lab/data-dashboard/', // Essential: This fixes the asset 404s
plugins: [react()],
worker: {
format: 'es',
},
});