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
-15
View File
@@ -1,15 +0,0 @@
# Example site block for the existing Caddy container. Caddy has to be attached
# to the external networks "wizard_website" and "wizard_api".
wizard.example.com {
encode zstd gzip
# Game server: REST + websocket (Caddy proxies websockets automatically).
# /internal/* (AI endpoint) is intentionally not exposed.
handle /api/* {
reverse_proxy wizard_server:8083
}
handle {
reverse_proxy wizard_website:8082
}
}
+10 -3
View File
@@ -6,12 +6,19 @@ server {
# Hashed build assets can be cached forever. # Hashed build assets can be cached forever.
location /assets/ { location /assets/ {
add_header Cache-Control "public, max-age=31536000, immutable"; 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 / { location / {
add_header Cache-Control "no-cache"; 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/ // https://vite.dev/config/
export default defineConfig({ export default defineConfig({
plugins: [react()], plugins: [react()],
// Relative asset URLs, so the app works under any path prefix (e.g. /website/).
base: './',
server: { server: {
// Forward API requests (including the websocket) to a locally running game server. // Forward API requests (including the websocket) to a locally running game server.
proxy: { proxy: {