Jellyfin Forum
Nginx Proxy Manager Config - Printable Version

+- Jellyfin Forum (https://forum.jellyfin.org)
+-- Forum: Support (https://forum.jellyfin.org/f-support)
+--- Forum: General Questions (https://forum.jellyfin.org/f-general-questions)
+--- Thread: Nginx Proxy Manager Config (/t-nginx-proxy-manager-config)



Nginx Proxy Manager Config - juanlasp - 2024-11-12

Hello everyone!
I'm trying to configure Jellyfin to serve over HTTPS using Nginx Proxy Manager (NPM), but I’m running into some issues.


This is my setup:
  • TrueNas host 192.168.1.91 (accessible on port 5050)
  • I have Jellyfin installation (accesible usgin http://192.168.1.91:20004
  • I setted up base URL to /jellyfin in my Dashboard.
  • NPM host (192.168.1.150)
NPM is configured with a ProxyHost for TrueNAS (192.168.1.91:5050) with SSL (Force SSL, HTTP/2 support, HSTS enabled), allowing secure access to the TrueNAS portal.  I also have two other apps configured as /app1 and /app2, both accessible via my NPM setup.

The issue arises when configuring Jellyfin with NPM. Here’s the current advanced configuration I have set up in NPM:
Code:
location /jellyfin/ {
    proxy_pass http://192.168.1.91:20004;
    proxy_buffering off;
    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;
    add_header X-Frame-Options "SAMEORIGIN";
    add_header X-XSS-Protection "0";
    add_header X-Content-Type-Options "nosniff";
add_header Content-Security-Policy "default-src https: data: blob: ; img-src 'self' https://* ; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' https://www.gstatic.com https://www.youtube.com blob:; worker-src 'self' blob:; connect-src 'self'; object-src 'none'; frame-ancestors 'self'";
}

I tried the official documentation here: https://jellyfin.org/docs/general/networking/nginx/#nginx-proxy-manager
And tried some changes trying make it work, but nothing is having a good result. Any ideas?

Sorry for my english


RE: Nginx Proxy Manager Config - TheDreadPirate - 2024-11-12

I am pretty sure you need to use the custom location UI to add /jellyfin/ instead of the advanced configuration tab.


RE: Nginx Proxy Manager Config - juanlasp - 2024-11-12

I just get this working. 

"^~ /jellyfin/" in the location directive (and the rewrite) was the solution. At the moment it is working fine. I have to test more

Code:
location ^~ /jellyfin/ {
    proxy_pass http://192.168.1.91:20004/;
    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-Host $http_host;
    proxy_buffering off;

    sub_filter '/web/' '/jellyfin/web/';
    sub_filter '/socket' '/jellyfin/socket';
    sub_filter '/api/' '/jellyfin/api/';
    sub_filter '/touchicon' '/jellyfin/web/touchicon'; # Redireccionar iconos
    sub_filter_once off;

    rewrite /jellyfin/(.*) /$1 break;
}