Complete architecture overhaul:
- Caddy is now the main proxy (port 8096)
- Only Xbox PlaybackInfo requests go to Python filter
- Everything else (WebSocket, streaming, API) goes directly to Jellyfin
Changes:
- Add Caddy service to docker-compose
- Use path_regexp for proper PlaybackInfo matching
- Remove method POST constraint (handled by path)
- Direct routing for non-Xbox requests
- WebSocket support for /socket endpoint
This fixes:
- 503 errors on normal requests
- 400 errors on WebSocket connections
- Performance issues from proxying everything
Architecture:
Client → Caddy → Check (path + User-Agent)
↓ Xbox PlaybackInfo → Python Filter → Jellyfin
↓ Everything else → Jellyfin
53 lines
1.1 KiB
YAML
53 lines
1.1 KiB
YAML
version: '3.8'
|
|
|
|
services:
|
|
jellyfin:
|
|
image: jellyfin/jellyfin:latest
|
|
container_name: jellyfin
|
|
volumes:
|
|
- /path/to/config:/config
|
|
- /path/to/cache:/cache
|
|
- /path/to/media:/media
|
|
environment:
|
|
- JELLYFIN_PublishedServerUrl=http://your-server:8096
|
|
restart: unless-stopped
|
|
networks:
|
|
- jellyfin
|
|
# IMPORTANT: No ports exposed! Only accessible via Caddy
|
|
|
|
xbox-filter:
|
|
build: .
|
|
container_name: jellyfin-xbox-filter
|
|
depends_on:
|
|
- jellyfin
|
|
# No ports exposed - only Caddy talks to this
|
|
environment:
|
|
- JELLYFIN_URL=http://jellyfin:8096
|
|
restart: unless-stopped
|
|
networks:
|
|
- jellyfin
|
|
|
|
caddy:
|
|
image: caddy:2-alpine
|
|
container_name: jellyfin-caddy
|
|
depends_on:
|
|
- jellyfin
|
|
- xbox-filter
|
|
ports:
|
|
- "8096:8096" # Public-facing port
|
|
volumes:
|
|
- ./Caddyfile:/etc/caddy/Caddyfile:ro
|
|
- caddy_data:/data
|
|
- caddy_config:/config
|
|
restart: unless-stopped
|
|
networks:
|
|
- jellyfin
|
|
|
|
networks:
|
|
jellyfin:
|
|
driver: bridge
|
|
|
|
volumes:
|
|
caddy_data:
|
|
caddy_config:
|