Cloudflare, how NOT TO violate the terms of Audio/Video Static HTML content

Hello, a few days ago Cloudflare disabled my site because of a possible violation of the Terms of Service for the storage or caching of non-HTML content, such as video or audio files.

Cloudflare unlocked my site and i don’t want my site to be disabled again.

I have a HLS Video player on my site delivering m3u8 and ts files in tag which looks like this:

    <script>
    const video = videojs("video");

    fetch("https://server1.domainname.com/obtain?id=1234&t=b43dbf0a5eb284b50a35ff5c0affbe7ce21f1e4e8d682904cb16ad620a2ce4f2").then(response => {
        response.json().then(parsed => {
            if (parsed.code !== 200) {
                return alert("Error");
            }

            video.src([
                { type: "application/x-mpegURL", src: `https://server1.domainname.com/live/videooo/index.m3u8?token=${parsed.token}` },
            ]);
        });
    });
</script>

What rules do i need to add to Cloudflare Page Rules not to violate Cloudflare Rules?

Now I have domainname.com/.m3u8* & domainname.com/.ts* Cache level: Bypass,
is it enough?

1 Like

This is when you’re passing your m3u8 content through the Cloudflare proxy. Cloudflare didn’t suspend your website for just caching the content, they suspended it because the content went through the proxy at all.

All you need to do to remedy the situation is have where you host the video content be on a separate subdomain (with the grey cloud :grey:) or hosted via a third party service.

Note that this isn’t because CF runs their own streaming service (Cloudflare Stream). CF doesn’t care if you roll your own servers, they just don’t want you running a bunch of non-website content through the proxy causing them to have to pay for bandwidth that is otherwise generously provided for free.

4 Likes

Okay, but i have a main site on https:// and when i deploy stream1.subdomain.com, tick off Cloudflare cache, i will not have access to SSL on stream1.subdomain.com and stream will not be on https, and main site will not let me play the video. So question is, how to have SSL on subdomain with DNS only Cloudflare option?

Edit: I figuret it. Just on main domain im using Cloudflare SSL, and on subdomains im using letsencrypt :slight_smile:

This topic was automatically closed after 30 days. New replies are no longer allowed.