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

Possibly incorrect nginx configuration in docs when using jellyfin in a docker container #903

Open
Oni opened this issue Mar 13, 2024 · 2 comments

Comments

@Oni
Copy link

Oni commented Mar 13, 2024

I've installed jellyfin in a docker container following the official documentation (https://jellyfin.org/docs/general/installation/container/) and using the official image:

docker run -d \
 --name=jellyfin \
 -p 8096:8096 \
 -v /my_config:/config \
 -v /my_cache:/cache \
 -v /my_media:/media:ro \
 -e PGID=my_pgid -e PUID=my_puid  \
 -e TZ=Europe/Rome \
 --restart unless-stopped \
jellyfin/jellyfin:2024031105

If I try to use the nginx config provided in the docs (https://jellyfin.org/docs/general/networking/nginx/) and I try to reach jellyfin container (jellyfin.mydomain.com or jellyfin.mydomain.com/web/) it fails (error 404).

It turns out that the offending line is:

# 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;
       ...
    }

It works with:

# 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/;
       ...
    }

Is the nginx documentation outdated? Or is the official image messing with "index.html"?

@FrostyZoob
Copy link

FrostyZoob commented Jul 24, 2024

Piggybacking on this thread since I encountered similar issues when using the supplied nginx reverse proxy config here:

https://jellyfin.org/docs/general/networking/nginx/#nginx-from-a-subdomain-jellyfinexampleorg

tl;dr: Using the nginx config as shown results in a 404. The fix was to simply delete the = / location block entirely. I'm not an nginx expert but it seems unnecessary. Can one of the devs speak to it's purpose?

Details:

I have nginx running on a separate server named docker-prod-01.mydomain.tld
I installed jellyfin via it's official docker container on a server named docker-prod-02.mydomain.tld

I verified that Jellyfin works by going to http://docker-prod-02.mydomain.tld:8096. It finds my media, plays it back...all the things. All good.

(As a quick aside: I noticed that when visiting the base URL, Jellyfin would redirect me to /web/index.html.)

Now I want to get it working through a reverse proxy so I have https and a simpler URL: https://media.mydomain.tld

I have a valid SSL cert for my domain created via acme.sh. It's installed on the nginx server (docker-prod-01) and it's used by other services proxied by nginx. I have verified that it works.

I applied the config shown here for "Nginx from a subdomain (jellyfin.example.org)" and made the bare minimum changes to get it to work for my setup: jellyfin.conf.clean.txt

I'd visit http://media.mydomain.tld and notice a redirect and then...blank page.'

Time to break out curl. I run the following command:

curl -I -L https://media.mydomain.tld

And this is what I get: nginx-borked-location.txt

After some experimenting, I deleted the = / location block entirely, restarted nginx, and visiting https://media.mydomain.tld redirected me to /web/index.html and I got the login screen.

Edit: Here's the output of curl -I -L https://media.mydomain.tld after the fix:
nginx-success.txt

Edit 2: I was using Jellyfin 10.8.13

@Oni
Copy link
Author

Oni commented Jul 24, 2024

tl;dr: Using the nginx config as shown results in a 404. The fix was to simply delete the = / location block entirely. I'm not an nginx expert but it seems unnecessary. Can one of the devs speak to it's purpose?

Apparently the NGINX config changed since when I've reported this bug.

The "web/" location is gone, so the "= /" is incorrectly redirecting to the missing "web/" location.

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

No branches or pull requests

2 participants