# HTTP is the safe default for a fully disconnected network. Terminate TLS at
# the customer's existing load balancer, or follow README.md to mount a local
# certificate directly into Caddy.
http://{$DOMAIN:localhost} {
    reverse_proxy app:3000
    # Compress everything except live streams (chat tokens, activity feed).
    # A compressed event stream makes content-inspecting proxies (TLS
    # inspection, antivirus/DLP gateways) hold the whole answer until it ends,
    # so users see it appear all at once. The streaming fetches always send
    # Accept: text/event-stream; the app also marks those responses
    # Content-Encoding: identity, which Caddy leaves alone.
    @compressible not header Accept *text/event-stream*
    encode @compressible gzip zstd

    header {
        X-Content-Type-Options "nosniff"
        Referrer-Policy "strict-origin-when-cross-origin"
        -Server
    }

    log {
        output stdout
        format console
    }
}
