From e0aa7c5d9177877dce89d3556582e323e4a6734c Mon Sep 17 00:00:00 2001 From: JPVenson Date: Sat, 31 Aug 2024 19:27:52 +0200 Subject: [PATCH] Removed video Cache section --- docs/general/networking/nginx.md | 41 -------------------------------- 1 file changed, 41 deletions(-) diff --git a/docs/general/networking/nginx.md b/docs/general/networking/nginx.md index a148fd3c9..0b7904048 100644 --- a/docs/general/networking/nginx.md +++ b/docs/general/networking/nginx.md @@ -281,47 +281,6 @@ map $request $secretfilter { access_log /var/log/nginx/access.log stripsecrets; ``` -### Cache Video Streams - -```conf -# Must be in HTTP block -# Set in-memory cache-metadata size in keys_zone, size of video caching and how many days a cached object should persist -proxy_cache_path /var/cache/nginx/jellyfin-videos levels=1:2 keys_zone=jellyfin-videos:100m inactive=90d max_size=35000m; -map $request_uri $h264Level { ~(h264-level=)(.+?)& $2; } -map $request_uri $h264Profile { ~(h264-profile=)(.+?)& $2; } - -# Set in Server block -location ~* ^/Videos/(.*)/(?!live) -{ - # Set size of a slice (this amount will be always requested from the backend by nginx) - # Higher value means more latency, lower more overhead - # This size is independent of the size clients/browsers can request - slice 2m; - - proxy_cache jellyfin-videos; - proxy_cache_valid 200 206 301 302 30d; - proxy_ignore_headers Expires Cache-Control Set-Cookie X-Accel-Expires; - proxy_cache_use_stale error timeout invalid_header updating http_500 http_502 http_503 http_504; - proxy_connect_timeout 15s; - proxy_http_version 1.1; - proxy_set_header Connection ""; - # Transmit slice range to the backend - proxy_set_header Range $slice_range; - - # This saves bandwidth between the proxy and jellyfin, as a file is only downloaded one time instead of multiple times when multiple clients want to at the same time - # The first client will trigger the download, the other clients will have to wait until the slice is cached - # Esp. practical during SyncPlay - proxy_cache_lock on; - proxy_cache_lock_age 60s; - - proxy_pass http://$jellyfin:8096; - proxy_cache_key "jellyvideo$uri?MediaSourceId=$arg_MediaSourceId&VideoCodec=$arg_VideoCodec&AudioCodec=$arg_AudioCodec&AudioStreamIndex=$arg_AudioStreamIndex&VideoBitrate=$arg_VideoBitrate&AudioBitrate=$arg_AudioBitrate&SubtitleMethod=$arg_SubtitleMethod&TranscodingMaxAudioChannels=$arg_TranscodingMaxAudioChannels&RequireAvc=$arg_RequireAvc&SegmentContainer=$arg_SegmentContainer&MinSegments=$arg_MinSegments&BreakOnNonKeyFrames=$arg_BreakOnNonKeyFrames&h264-profile=$h264Profile&h264-level=$h264Level&slicerange=$slice_range"; - - # add_header X-Cache-Status $upstream_cache_status; # This is only for debugging cache - -} -``` - ### Cache Images ```conf