HestiaCP + jellyfin. Reverse proxy NGINX

I do not speak English. So I have to deal with Google translator :wink:

Hello, honorable HestiaCP community :slightly_smiling_face:

How to connect the reverse proxy nginx under jellyfin? The Jellifin documentation method does not work. I have a supodomena connected to Hestiacp. HestiaCP generates its own NGINX configuration files, probably the problem is here.

Documentation Jellyfin:
https://jellyfin.org/docs/general/networking/nginx.html

Regards

Create a custom template, it should basicly w9rk but i kever tried ojt jellyfin: Web domains and SSL Certicates — Hestia Control Panel documentation

I created a new jellyfin.tpl template. I chose it in the HestiaCP panel for subdomain. And I have a message: Error: jellyfin proxy template doesn’t exist

you need to create both, tpl and stpl

Not work. Under the subdomain, it is displayed:
We’re working on it!
This site is currently under construction.
Please check back soon.

I tried this for http:

It works for me.

server {
    listen      %ip%:%proxy_port%;
    server_name %domain%;

location / {
    proxy_pass      http://%ip%:8096;
    }
}

An example from Jellyfin documentation does not work. Why?

server {
      listen %proxy_port%;
      listen [::]:%proxy_port%;
      server_name %domain%;

      access_log /var/log/nginx/jellyfin.access;
      error_log /var/log/nginx/jellyfin.error;

      set $jellyfin %ip%;

      location / {
          proxy_pass http://%ip%:8096;
          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 buffering when the nginx proxy gets very resource heavy upon streaming
          proxy_buffering off;
      }

      # location block for /web - This is purely for aesthetics so /web/#!/ works instead of having to go to /web/index.html/#!/
      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;
      }

      location /socket {
          # Proxy Jellyfin Websockets traffic
          proxy_pass http://$%ip%:8096;
          proxy_http_version 1.1;
          proxy_set_header Upgrade $http_upgrade;
          proxy_set_header Connection "upgrade";
          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;
      }

        # Security / XSS Mitigation Headers
        add_header X-Frame-Options "SAMEORIGIN";
        add_header X-XSS-Protection "1; mode=block";
        add_header X-Content-Type-Options "nosniff";

}