Caddyfile 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. {
  2. http_port 80
  3. }
  4. # API subdomain — прокси на backend + MinIO (HTTP, SSL на Synology)
  5. http://api.{$DOMAIN} {
  6. handle_path /s3/* {
  7. reverse_proxy minio:9000 {
  8. header_up Host {host}
  9. header_up X-Real-IP {remote}
  10. }
  11. }
  12. reverse_proxy backend:8080 {
  13. header_up Host {host}
  14. header_up X-Real-IP {remote}
  15. }
  16. header {
  17. X-Content-Type-Options "nosniff"
  18. X-Frame-Options "DENY"
  19. Referrer-Policy "strict-origin-when-cross-origin"
  20. Permissions-Policy "geolocation=(self), microphone=(), camera=()"
  21. }
  22. }
  23. # Frontend main domain
  24. http://{$DOMAIN} {
  25. reverse_proxy frontend:3000 {
  26. header_up Host {host}
  27. header_up X-Real-IP {remote}
  28. }
  29. header {
  30. X-Content-Type-Options "nosniff"
  31. X-Frame-Options "DENY"
  32. Referrer-Policy "strict-origin-when-cross-origin"
  33. Permissions-Policy "geolocation=(self), microphone=(), camera=()"
  34. Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; img-src 'self' data: blob: https://*.basemaps.cartocdn.com https://api.{$DOMAIN}; font-src 'self' data:; connect-src 'self' wss://api.{$DOMAIN} https://api.{$DOMAIN}; frame-ancestors 'none';"
  35. }
  36. @static {
  37. path /_next/static/*
  38. path /static/*
  39. path /images/*
  40. path /favicon.ico
  41. }
  42. header @static Cache-Control "public, max-age=31536000, immutable"
  43. encode zstd gzip
  44. }