From ca9f2144e42c99c438c82977de72492ad235ae05 Mon Sep 17 00:00:00 2001 From: Andrew Geo <94297792+Andrew-Geo@users.noreply.github.com> Date: Sat, 1 Feb 2025 22:10:46 +0200 Subject: [PATCH] Rewrote changing protocols in apache, added a cache-control header directive. The previous directives for managing Websocket connection was not working with syncplay. Fixed with a simple rewrite rule. Added a strict cache control header for not keeping cache. This fixes UI updating (e.g. when reloading libraries) and some syncplay issues. --- docs/general/networking/apache.md | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/docs/general/networking/apache.md b/docs/general/networking/apache.md index db99206da..2415076d9 100644 --- a/docs/general/networking/apache.md +++ b/docs/general/networking/apache.md @@ -36,11 +36,17 @@ title: Apache RequestHeader set X-Forwarded-Proto "https" RequestHeader set X-Forwarded-Port "443" - ProxyPass "/socket" "ws://SERVER_IP_ADDRESS:8096/socket" - ProxyPassReverse "/socket" "ws://SERVER_IP_ADDRESS:8096/socket" - - ProxyPass "/" "http://SERVER_IP_ADDRESS:8096/" - ProxyPassReverse "/" "http://SERVER_IP_ADDRESS:8096/" + # Apache should be able to know when to change protocols (between WebSocket and HTTP) + RewriteEngine On + RewriteCond %{HTTP:Upgrade} =websocket + RewriteRule /(.*) ws://SERVER_IP_ADDRESS:8096/socket/$1 [P,L] + RewriteCond %{HTTP:Upgrade} !=websocket + RewriteRule /(.*) http://SERVER_IP_ADDRESS:8096/$1 [P,L] + + # Sometimes, Jellyfin requires clients to empty their cache to display and function correctly. + # This header tells clients not to keep any cache and is quite strict on that. + # This might also fix some syncplay issues (#5485 and #8140 @ https://github.com/jellyfin/jellyfin-web/issues/) + Header set Cache-Control "no-store, no-cache, must-revalidate, max-age=0" SSLEngine on SSLCertificateFile /etc/letsencrypt/live/DOMAIN_NAME/fullchain.pem