[Bug]: Safari video streaming compatibility issues with Coolify's proxy configuration
Error Message and Logs
Problem
Videos served through Coolify's Traefik proxy configuration do not play correctly in Safari browsers. This affects all services that serve video content, including:
- MinIO/S3 storage
- Next.js applications with videos in public directories
- Probably any other service hosting video content
This appears to be due to improper handling of HTTP headers required for proper video streaming.
Technical Details
Safari requires specific HTTP headers for proper video streaming:
-
Accept-Ranges: bytesheader must be present - Content should not be compressed with gzip/zstd for video files
- Proper range request handling is needed
The current auto-generated proxy configuration in Coolify applies compression to all content types and doesn't ensure the Accept-Ranges header is present for media files.
Observed Headers
When requesting video content, the following problematic headers are observed:
content-encoding: gzip
# Missing Accept-Ranges: bytes header
Expected Behavior
Videos should play correctly in all browsers, including Safari.
Suggested Fix
Modify the proxy configuration to:
- Disable compression for common video file extensions (.mp4, .webm, .mov, etc.)
- Add
Accept-Ranges: bytesheader for video content - Properly handle range requests
This could be implemented by:
- Adding configuration options in the Coolify UI for handling media content
- Creating specific middleware rules for common media file extensions
- Allowing users to add custom headers per content type or path
- Providing an intuitive way to modify proxy behavior for specific file types
Environment
- Coolify version: 4.0.0-beta.395
- Browser: Safari (all versions)
- Affected configurations: Any service serving video content through Coolify
Impact
This issue prevents proper video playback on approximately 15-20% of all browsers (Safari desktop and mobile), significantly impacting user experience for sites that include video content.
Steps to Reproduce
- Deploy any service on Coolify that serves video files
- Request an MP4 video file
- Try to play the video in Safari browser
- Video fails to play or plays incorrectly
Example Repository URL
No response
Coolify Version
4.0.0-beta.395
Are you using Coolify Cloud?
Yes (Coolify Cloud)
Operating System and Version (self-hosted)
No response
Additional Information
No response
I'll add some more info onto this:
This does not only affect safari, while safari refuses to play the file completely it also affects other browsers like Chrome and Firefox when it comes to "seeking" a file. Because the Accept-Ranges header is missing it will not allow you to seek a file at all.
I'm unsure if there is some header stripping going on because I do run caddy v2 as a proxy inside the docker-compose file to tie together a few things and then expose a directory with file_server and this is then proxied through Coolifys Traefik to the outside world. I know that caddy v2 sets the correct headers for file serving and video file serving, but it seems once everything goes through Traefik those are just missing.
Is there any workaround for this bug?
Is there any workaround for this bug?
I started serving the videos from Cloudflare
Is there any update on this?