Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add instuction how to inject clientscript via nginx reverse proxy config #42

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tam1m
Copy link

@tam1m tam1m commented Aug 31, 2022

An alternative solution to inject the clientscript into the webclient.

This is using the Nginx ngx_http_sub_module module, works when using Nginx as reverse proxy in front of Jellyfin (regardless of install method) and does not require any file/owner/permissions changes as Nginx simply injects the code dynamically on request

@bin101
Copy link

bin101 commented May 3, 2023

@tam1m I also had to disable caching in nginx for the /web/ location:

	location = /web/ {
# Proxy main Jellyfin traffic
		proxy_pass http://$jellyfin:8096/web/index.html;
		proxy_set_header Host $host;
		proxy_set_header X-Real-IP $remote_addr;
		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
		proxy_set_header X-Forwarded-Proto $scheme;
		proxy_set_header X-Forwarded-Protocol $scheme;
		proxy_set_header X-Forwarded-Host $http_host;
# disable caching
		add_header Last-Modified $date_gmt;
		add_header Cache-Control 'private no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0';
    		if_modified_since off;
    		expires off;
    		etag off;
# inject Jellyscrub script into the webclient
		proxy_set_header Accept-Encoding "";
		sub_filter
			'</body>'
			'<script plugin="Jellyscrub" version="1.0.0.0" src="/Trickplay/ClientScript"></script>
			</body>';
		sub_filter_once on;
	}

Otherwise the inject sometimes didn't happen. Did you also faced this issue? Or maybe have a better solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants