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 }