Caddyfile 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. {
  2. http_port 80
  3. }
  4. # API subdomain — прокси на backend + MinIO (HTTP, SSL на Synology)
  5. http://api.{$DOMAIN} {
  6. handle_path /files/* {
  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. header_up X-Forwarded-Proto {scheme}
  16. }
  17. header {
  18. X-Content-Type-Options "nosniff"
  19. X-Frame-Options "DENY"
  20. Referrer-Policy "strict-origin-when-cross-origin"
  21. Permissions-Policy "geolocation=(self), microphone=(), camera=()"
  22. }
  23. }
  24. # Frontend main domain
  25. http://{$DOMAIN} {
  26. reverse_proxy frontend:3000 {
  27. header_up Host {host}
  28. header_up X-Real-IP {remote}
  29. }
  30. header {
  31. X-Content-Type-Options "nosniff"
  32. X-Frame-Options "DENY"
  33. Referrer-Policy "strict-origin-when-cross-origin"
  34. Permissions-Policy "geolocation=(self), microphone=(), camera=()"
  35. Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline'; 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';"
  36. }
  37. @static {
  38. path /_next/static/*
  39. path /static/*
  40. path /images/*
  41. path /favicon.ico
  42. }
  43. header @static Cache-Control "public, max-age=31536000, immutable"
  44. encode zstd gzip
  45. }