Accept-ranges and content-length headers not forwarded by Cloudflare

Hello,

I have an issue with MP4 videos on my website: they can’t be played on Apple devices.

This has been reported here: MP4 Won't Load in Safari Using CloudFlare but there is no real fix.

I noticed that 2 headers are missing when Cloudflare is used.

Without CF:

[email protected] ~/mstdn> curl -I https://media.mstdn.io/mstdn-media/media_attachments/files/003/417/987/original/5690303f4c5f9449.mp4
HTTP/2 200
server: nginx
date: Sat, 27 Oct 2018 14:19:13 GMT
content-type: video/mp4
content-length: 101615
vary: Accept-Encoding
cache-control: max-age=315576000
etag: "80fa46b3e2c68e316756b4625fdec0f1"
last-modified: Sat, 27 Oct 2018 09:55:53 GMT
x-amz-id-2: E/qOA6K8T8g2De6lYWIqUtKrlCHJd5ICCVXIS3zZBl7BwEq5b51urgpH7XXGgoSnlcDZFMsW5qBE
x-amz-request-id: 3CAD47C4796E33AE
x-cached: HIT
accept-ranges: bytes

With CF:

[email protected] ~/mstdn> curl -I https://media.mstdn.io/mstdn-media/media_attachments/files/003/417/987/original/5690303f4c5f9449.mp4
HTTP/2 200
date: Sat, 27 Oct 2018 14:14:05 GMT
content-type: video/mp4
set-cookie: __cfduid=d22694f13bb7b7b1f9de3a6221689ab431540649645; expires=Sun, 27-Oct-19 14:14:05 GMT; path=/; domain=.mstdn.io; HttpOnly; Secure
vary: Accept-Encoding
cache-control: max-age=315576000
etag: W/"80fa46b3e2c68e316756b4625fdec0f1"
last-modified: Sat, 27 Oct 2018 09:55:53 GMT
x-amz-id-2: E/qOA6K8T8g2De6lYWIqUtKrlCHJd5ICCVXIS3zZBl7BwEq5b51urgpH7XXGgoSnlcDZFMsW5qBE
x-amz-request-id: 3CAD47C4796E33AE
x-cached: HIT
strict-transport-security: max-age=15552000; includeSubDomains; preload
x-content-type-options: nosniff
expect-ct: max-age=604800, report-uri="https://report-uri.Cloudflare.com/cdn-cgi/beacon/expect-ct"
server: Cloudflare
cf-ray: 4705c45c2b6c3bb1-CDG

content-length and accept-ranges are missing. I assume this is why I have issues in Safari.

This has been reported 2 times already:

But no solution either.

I found websites behing CF where these 2 headers are forwarded, so I wonder what can I do to fix that. I tried bypassing the cache but it didn’t change anything.

2 Likes

Still nothing on this?

I’m having a lot of trouble with this too, nobody on Safari can use our website properly, they have to download the videos and this is not OK!

Now might be a good time to open a Support ticket:
Login to Cloudflare and then contact Cloudflare Support

amazon hosted ??? could be related ? I suspect amazon hosted mp4 is being cached and not passing on the header ? edit: oh original post is 21 days old

I have mp4 videos served via my Nginx origin with sliced byte range caching via nginx proxy cache (configured origin nginx to cache in 1MB or 2MB chunks) and only time accept-ranges header was missing via CF served domains is if I forget to add the proxy_cache header on my Nginx origin. Once I do, shows up fine for me

curl -I https://domain.com.com/videos/cmm-centmin.sh-menu.mp4
HTTP/2 200 
date: Sat, 17 Nov 2018 20:07:28 GMT
content-type: video/mp4
content-length: 9730773
set-cookie: __cfduid=d45bcd37992f061e5702cc392c00f8c991542485247; expires=Sun, 17-Nov-19 20:07:27 GMT; path=/; domain=.centminmod.com; HttpOnly
last-modified: Sat, 01 Sep 2018 05:32:09 GMT
etag: "5b8a2459-947ad5"
x-powered-by: centminmod
backend-mp4: 1
accept-ranges: bytes
sliced-cache: HIT
sliced: 1
accept-ranges: bytes
expect-ct: max-age=604800, report-uri="https://report-uri.Cloudflare.com/cdn-cgi/beacon/expect-ct"
server: Cloudflare
cf-ray: 47b4d2de6b5dc1b8-IAD

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