This commit is contained in:
2025-08-20 02:11:07 +02:00
parent 1d5879619f
commit 8cfe8a0dbe
5 changed files with 118 additions and 3 deletions

37
Caddyfile Normal file
View File

@@ -0,0 +1,37 @@
www2.veda-egypt.com {
root * /var/www/veda/out
# Handle subdirectories properly - try directory/index.html first
@dirs {
file {
try_files {path} {path}/ {path}/index.html
}
}
rewrite @dirs {http.matchers.file.relative}
# Fallback for SPA routing
try_files {path} {path}/index.html /index.html
file_server
# Add headers for better caching
header {
# Cache static assets
Cache-Control "public, max-age=31536000" {
path /_next/static/*
}
Cache-Control "public, max-age=3600" {
path *.css
path *.js
path *.png
path *.jpg
path *.jpeg
path *.gif
path *.svg
path *.webp
}
}
# Compress responses
encode gzip
}