Caddyfile raw

   1  # Zlattea Caddyfile - auto TLS via Let's Encrypt
   2  # SITE_DOMAIN comes from the caddy environment (see install.sh); defaults to zlattea.smesh.lol
   3  # ZLATTEA_DIR is the project install dir; defaults to /opt/zlattea
   4  
   5  {$SITE_DOMAIN:zlattea.smesh.lol} {
   6      # API (strips the /api prefix; Hono routes are unprefixed)
   7      handle_path /api/* {
   8          reverse_proxy 127.0.0.1:3001
   9      }
  10  
  11      # product images uploaded at runtime go straight to public/images/products;
  12      # serve them directly from disk (Astro only bundles build-time assets)
  13      handle_path /images/products/* {
  14          root * {$ZLATTEA_DIR:/opt/zlattea}/public/images/products
  15          file_server
  16      }
  17  
  18      # everything else -> Astro SSR standalone server (also serves static assets)
  19      handle {
  20          reverse_proxy 127.0.0.1:3002
  21      }
  22  
  23      header {
  24          X-Content-Type-Options "nosniff"
  25          X-Frame-Options "DENY"
  26          Referrer-Policy "strict-origin-when-cross-origin"
  27      }
  28  
  29      log {
  30          output file /var/log/zlattea/caddy-access.log
  31      }
  32  }
  33