2024-02-21, 07:57 AM
(This post was last modified: 2024-02-21, 08:05 AM by Iacov. Edited 1 time in total.)
well, apparently i forgot to tell npm where to route the request in the "advanced" tab
the improved code looks like this and is to be posted in the "advanced" tab
i did have to adapt proxy_pass http://$jellyfin:8096; to my actual ip - but npm is content now and i can access the site
i just don't know how to test if it works now
because the / location worked even without a custom location or the advanced tab
edit: but had do delete the code again, because having this code active prohibited the dashboard of showing playback info in real time. (e.g. the time did not refresh on its own when looking at the current playback...always hat to f5 the page)
the improved code looks like this and is to be posted in the "advanced" tab
Code:
location / {
# Proxy main Jellyfin traffic
proxy_pass http://$jellyfin:8096;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Protocol $scheme;
proxy_set_header X-Forwarded-Host $http_host;
proxy_headers_hash_max_size 2048;
proxy_headers_hash_bucket_size 128;
# Security / XSS Mitigation Headers
add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "0";
add_header X-Content-Type-Options "nosniff";
# Content Security Policy
#add_header Content-Security-Policy "default-src https: data: blob: http://image.tmdb.org; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' https://www.gstatic.com/cv/js/sender/v1/cast_sender.js https://www.gstatic.com/eureka/clank/95/cast_sender.js https://www.gstatic.com/eureka/clank/96/cast_sender.js https://www.gstatic.com/eureka/clank/97/cast_sender.js https://www.youtube.com blob:; worker-src 'self' blob:; connect-src 'self'; object-src 'none'; frame-ancestors 'self'";
}
location /socket {
# Proxy Jellyfin Websockets traffic
proxy_pass http://$jellyfin:8096;
proxy_set_header Connection "upgrade";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Protocol $scheme;
proxy_set_header X-Forwarded-Host $http_host;
# Security / XSS Mitigation Headers
add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "0";
add_header X-Content-Type-Options "nosniff";
# Content Security Policy
#add_header Content-Security-Policy "default-src https: data: blob: http://image.tmdb.org; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' https://www.gstatic.com/cv/js/sender/v1/cast_sender.js https://www.gstatic.com/eureka/clank/95/cast_sender.js https://www.gstatic.com/eureka/clank/96/cast_sender.js https://www.gstatic.com/eureka/clank/97/cast_sender.js https://www.youtube.com blob:; worker-src 'self' blob:; connect-src 'self'; object-src 'none'; frame-ancestors 'self'";
}
i did have to adapt proxy_pass http://$jellyfin:8096; to my actual ip - but npm is content now and i can access the site
i just don't know how to test if it works now
because the / location worked even without a custom location or the advanced tab
edit: but had do delete the code again, because having this code active prohibited the dashboard of showing playback info in real time. (e.g. the time did not refresh on its own when looking at the current playback...always hat to f5 the page)