• 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 Reverse Proxy Redirect Looping

     
    • 0 Vote(s) - 0 Average

    NGINX Reverse Proxy Redirect Looping

    william-
    Offline

    Junior Member

    Posts: 2
    Threads: 1
    Joined: 2024 Mar
    Reputation: 0
    Country:United States
    #1
    2024-03-13, 11:50 PM (This post was last modified: 2024-03-14, 12:01 AM by william-. Edited 1 time in total.)
    Hey all! I've got jellyfin and nginx both running in separate containers on the same machine and I'm having a hard time getting nginx to pass requests back to jellyfin properly. I want to be able to access this at apps.home/jellyfin. The initial visit seems to work correctly, but then the redirect to /web/index just keeps redirecting over and over again forever. I have set the base url setting in jellyfin to be "/jellyfin".

    I've tried removing the trailing / on proxy_pass http://apps.home:8096;, but then I just get 404 from nginx.

    Any thoughts?


    server {
        listen 80;
        server_name apps.home;

        location /jellyfin/ {
        proxy_pass http://apps.home:8096/;
        proxy_pass_request_headers on;
        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_set_header Upgrade $http_upgrade;
        proxy_set_header Connection $http_connection;
        proxy_buffering off;
        }
    }



    docker run -d \
      --name jellyfin \
      --user $(id -u):$(id -g) \
      -v /mnt/nfs/media/movies:/media/movies \
      -v /mnt/nfs/media/shows:/media/shows \
      -v /mnt/nfs/media/shorts:/media/shorts \
      -v /srv/jellyfin/config:/config \
      -v /srv/jellyfin/cache:/cache \
      -p 8096:8096 \
      jellyfin/jellyfin



    docker run -d --name apps-nginx --restart=always -p 80:80 -p 443:443 apps-nginx



    FROM nginx:latest

    COPY sites-available/ /etc/nginx/sites-available/
    COPY nginx.conf /etc/nginx/nginx.conf

    EXPOSE 80 443

    RUN mkdir -p /etc/nginx/sites-enabled
    RUN ln -s /etc/nginx/sites-available/jellyfin.conf /etc/nginx/sites-enabled/

    CMD ["nginx", "-g", "daemon off;"]



    user  nginx;
    worker_processes  auto;

    error_log  /var/log/nginx/error.log notice;
    pid        /var/run/nginx.pid;


    events {
        worker_connections  1024;
    }

    http {
        include      /etc/nginx/mime.types;
        default_type  application/octet-stream;

        log_format main '$remote_addr - $remote_user [$time_local] "$request" '
                    '$status $body_bytes_sent "$http_referer" '
                    '"$http_user_agent" "$http_x_forwarded_for" '
                    '-> $upstream_addr';

        access_log  /var/log/nginx/access.log  main;

        sendfile        on;
        #tcp_nopush    on;

        keepalive_timeout  65;

        #gzip  on;

        include /etc/nginx/conf.d/*.conf;
        include /etc/nginx/sites-available/*.conf;
    }
    TheDreadPirate
    Offline

    Community Moderator

    Posts: 15,375
    Threads: 10
    Joined: 2023 Jun
    Reputation: 460
    Country:United States
    #2
    2024-03-14, 01:34 AM (This post was last modified: 2024-03-14, 01:34 AM by TheDreadPirate.)
    You can't use the apps.home as both the server_name and the proxy pass address. For the proxy pass you need to provide an IP or, if you're using a host name, you need to provide a resolver.
    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]
    william-
    Offline

    Junior Member

    Posts: 2
    Threads: 1
    Joined: 2024 Mar
    Reputation: 0
    Country:United States
    #3
    2024-03-17, 07:09 PM
    I forgot to mention that I have a local dns record setup for apps.home.

    Turns out that my configuration above did work, I just needed to restart the jellyfin container for the base url to work correctly.
    « 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