legendofworlds.com {
    encode zstd gzip
    root * /opt/lttprs/current/site

    # Only the local game service may register as a world's server.
    @serverRole query role=server
    respond @serverRole "Server registration is private" 403

    @signalling path /lttp-* /lttpmp-* /lttpsrv-* /status/*
    handle @signalling {
        reverse_proxy 127.0.0.1:3536
    }

    handle /healthz {
        respond "ok" 200
    }

    handle {
        header X-Content-Type-Options nosniff
        header Referrer-Policy strict-origin-when-cross-origin
        # Stable filenames must revalidate after a release.
        header Cache-Control "public, max-age=0, must-revalidate"
        file_server
    }
}

www.legendofworlds.com {
    redir https://legendofworlds.com{uri} permanent
}
