• Login
  • Register
  • Login Register
    Login
    Username/Email:
    Password:
    Or login with a social network below
  • Forum
  • Website
  • GitHub
  • Status
  • Translation
  • Features
  • Team
  • Rules
  • Help
  • Feeds
User Links
  • Login
  • Register
  • Login Register
    Login
    Username/Email:
    Password:
    Or login with a social network below

    Useful Links Forum Website GitHub Status Translation Features Team Rules Help Feeds
    Jellyfin Forum Support Troubleshooting nginx config

     
    • 0 Vote(s) - 0 Average

    nginx config

    Need help with my nginx config for jellyfin docker service
    julipuli
    Offline

    Junior Member

    Posts: 1
    Threads: 1
    Joined: 2024 Jun
    Reputation: 0
    #1
    2024-06-27, 10:33 PM
    I am hosting jellyfin as a docker container. It was working perfectly fine until i updated my server and the jellyfin container.

    I can access jellyfin without problems via the ip:port. Access over my domain is also possible, but not anymore via via the subdomain.domain.org/ route. I can only access the web interface via subdomain.domain.org/web/index.html. Wouldn't be much of a problem but also my mobile app does not work anymore at all. When i configure the domain to connect to in the app, it just gives an error that the connection could not be established.

    When i access the / route it redirect to /web/ which results in a 404.

    This is my sites-enabled/jellyfin config:


    server {
          server_name subdomain.domain.org;

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

          set $jellyfin 127.0.0.1;

          location / {
              proxy_pass http://127.0.0.1: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://$127.0.0.1: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";


        listen 443 ssl; # managed by Certbot
        ssl_certificate /etc/letsencrypt/live/subdomain.domain.org/fullchain.pem; # managed by Certbot
        ssl_certificate_key /etc/letsencrypt/live/subdomain.domain.org/privkey.pem; # managed by Certbot
        include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
        ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

    }

    server {
        if ($host = subdomain.domain.org) {
            return 301 https://$host$request_uri;
        } # managed by Certbot


          listen 80;
          server_name subdomain.domain.org;
        return 404; # managed by Certbot


    }
    TheDreadPirate
    Offline

    Community Moderator

    Posts: 15,374
    Threads: 10
    Joined: 2023 Jun
    Reputation: 460
    Country:United States
    #2
    2024-06-27, 10:42 PM (This post was last modified: 2024-06-27, 10:43 PM by TheDreadPirate.)
    You need to remove this section.

    Code:
    # 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;
    }

    As mentioned in our 10.9 annoucement blog post, this section is obsolete.

    https://jellyfin.org/posts/jellyfin-rele...n%2010.9.z.
    Jellyfin 10.10.7 (Docker)
    Ubuntu 24.04.2 LTS w/HWE
    Intel i3 12100
    Intel Arc A380
    OS drive - SK Hynix P41 1TB
    Storage
        4x WD Red Pro 6TB CMR in RAIDZ1
    [Image: GitHub%20Sponsors-grey?logo=github]
    1
    pixel24
    Offline

    Member

    Posts: 196
    Threads: 56
    Joined: 2023 Aug
    Reputation: 1
    Country:Germany
    #3
    2024-06-28, 07:30 AM
    Interesting, I missed the note in the announcement :-(

    I have this block in my nginx configuration:

    Code:
        location /socket {
            # Proxy Jellyfin Websockets traffic
            proxy_pass http://$jellyfin: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;
        }

    It doesn't start with ^ though. Do I need to remove that?
    TheDreadPirate
    Offline

    Community Moderator

    Posts: 15,374
    Threads: 10
    Joined: 2023 Jun
    Reputation: 460
    Country:United States
    #4
    2024-06-28, 03:21 PM
    You need a /socket location. Here is my nginx config for reference (I need to clean it up).

    https://sourceb.in/auQ7583d3q
    Jellyfin 10.10.7 (Docker)
    Ubuntu 24.04.2 LTS w/HWE
    Intel i3 12100
    Intel Arc A380
    OS drive - SK Hynix P41 1TB
    Storage
        4x WD Red Pro 6TB CMR in RAIDZ1
    [Image: GitHub%20Sponsors-grey?logo=github]
    « Next Oldest | Next Newest »

    Users browsing this thread: 1 Guest(s)


    • View a Printable Version
    • Subscribe to this thread
    Forum Jump:

    Home · Team · Help · Contact
    © Designed by D&D - Powered by MyBB
    L


    Jellyfin

    The Free Software Media System

    Linear Mode
    Threaded Mode