voxora.sbs {
    header /games.json Access-Control-Allow-Origin "*"


    # VOXORA_SHORT_INVITE_171
    @voxoraInvite171 path /171 /171/
    redir @voxoraInvite171 https://app.voxora.sbs/join/171 302

    root * /srv/voxora-site
    file_server
}

# Backspace — Caddy reverse proxy configuration
# DOMAIN is read from the container environment (set via docker-compose.yml)

{$DOMAIN} {

    # VOXORA_GIFT_BADGES_TRANSPARENT_V1
    @voxoraGiftBadges path /badges/gift1.png /badges/gift5.png /badges/gift10.png /badges/gift50.png

    route @voxoraGiftBadges {
        root * /srv/voxora-site
        header Cache-Control "no-cache, must-revalidate"
        file_server
    }

    # LiveKit signaling — strip /livekit prefix, forward to host-mode LiveKit
    handle_path /livekit/* {
        reverse_proxy host.docker.internal:7880
    }

    # Backspace API, WebSocket, and frontend — Docker DNS resolves "backspace"
    reverse_proxy backspace:3000
}
