# AvianVisitors — Caddy snippet. # Drop into /etc/caddy/conf.d/ and add `import /etc/caddy/conf.d/*.caddy` # to the main Caddyfile (the installer does this for you). # # Default: serves the collage locally at http://birdnet.local/collage/ # with no auth. For the optional Cloudflare/HA forwarded deployment, # see ../forwarding/. (avian_common) { # CORS — collage is a single-origin static app; loose for the JSON # endpoints so HA dashboards etc. can read them. @json path /api/*.json header @json { Access-Control-Allow-Origin "*" Cache-Control "no-cache" } } # Frontend lives at http://birdnet.local/collage/ http://birdnet.local { import avian_common # Static collage UI handle_path /collage/* { root * /var/www/avian file_server } redir /collage /collage/ # PHP shims for recent.json / lifelist.json / firstseen.json / # timeseries.json — served from BirdNET-Pi's existing PHP root. handle_path /api/* { root * /home/monalisa/BirdSongs/Extracted php_fastcgi unix//run/php/php8.2-fpm.sock file_server } }