Caddyfile 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. goonblog.thevakhovske.eu.org {
  2. # Enable automatic HTTPS
  3. # Caddy will automatically get and renew SSL certificates
  4. # Serve the React frontend (static files)
  5. root * dist
  6. # Try to serve static files first, then fallback to index.html for SPA routing
  7. try_files {path} /index.html
  8. # API routes - proxy to backend
  9. handle /api/* {
  10. reverse_proxy localhost:3001
  11. }
  12. # Health check endpoint
  13. handle /health {
  14. reverse_proxy localhost:3001
  15. }
  16. # Serve static files with proper headers
  17. header /assets/* {
  18. Cache-Control "public, max-age=31536000, immutable"
  19. }
  20. # Security headers
  21. header {
  22. # Enable HSTS
  23. Strict-Transport-Security "max-age=63072000; includeSubDomains; preload"
  24. # Prevent clickjacking
  25. X-Frame-Options "DENY"
  26. # Prevent MIME type sniffing
  27. X-Content-Type-Options "nosniff"
  28. # XSS protection
  29. X-XSS-Protection "1; mode=block"
  30. # Referrer policy
  31. Referrer-Policy "strict-origin-when-cross-origin"
  32. # Content Security Policy (adjust as needed)
  33. Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; img-src 'self' data: https:; font-src 'self' data:;"
  34. }
  35. # Gzip compression
  36. encode gzip
  37. # Logging
  38. log {
  39. output file /var/log/caddy/gooneral-wheelchair.log
  40. format json
  41. }
  42. }