This commit is contained in:
2026-09-27 09:56:28 +02:00
parent 6d011d474f
commit 00c73306d7
3 changed files with 12 additions and 18 deletions
+10 -3
View File
@@ -6,12 +6,19 @@ server {
# Hashed build assets can be cached forever.
location /assets/ {
add_header Cache-Control "public, max-age=31536000, immutable";
try_files $uri =404;
try_files $uri @strip_prefix;
}
# Single page app: always serve index.html.
location / {
add_header Cache-Control "no-cache";
try_files $uri /index.html;
try_files $uri @strip_prefix;
}
# The reverse proxy may forward requests with their path prefix
# (e.g. /website/assets/app.js). Drop leading segments until a file
# matches; everything else is the single page app.
location @strip_prefix {
rewrite ^/[^/]+(/.+)$ $1 last;
rewrite ^ /index.html last;
}
}
+2
View File
@@ -4,6 +4,8 @@ import { defineConfig } from 'vite'
// https://vite.dev/config/
export default defineConfig({
plugins: [react()],
// Relative asset URLs, so the app works under any path prefix (e.g. /website/).
base: './',
server: {
// Forward API requests (including the websocket) to a locally running game server.
proxy: {