close
Skip to content

502 Bad Gateway error #71

@kromsam

Description

@kromsam

linuxserver.io


Expected Behavior

No 502 Bad Gateway error when opening Jellyfin, through the URL.
No ERR_CONNECTION_REFUSED when opening Jellyfin through ip address.

Current Behavior

I get a 502 Bad Gateway error when I visit through the URL.
I get a ERR_CONNECTION_REFUSED when opening Jellyfin through ip address.

Steps to Reproduce

  1. Go to url / ip address of my jellyfin instance
  2. Get error

Environment

OS: OMV
CPU architecture: arm32
How docker service was installed: From the docker repo

Command used to create docker container (run/create/compose/screenshot)

# Let's Encrypt
  letsencrypt:
    container_name: letsencrypt
    image: linuxserver/swag
    restart: always
    environment:
      - PUID=${PUID}
      - PGID=${PGID}
      - TZ=${TZ}
      - URL=${TLD}
      - SUBDOMAINS=${SUBS}
      - VALIDATION=${VAL}
      - EMAIL=${MAILADRES}
    volumes:
      - ${APPDATA}/Letsencrypt:/config
    networks:
      - jellyfin_net
    ports:
      - 446:443
      - 82:80
    cap_add:
      - NET_ADMIN

# Jellyfin
  jellyfin:
    container_name: jellyfin
    image: linuxserver/jellyfin
    restart: always
    environment:
      - PUID=${PUID}
      - PGID=${PGID}
      - TZ=${TZ}
    volumes:
      - ${APPDATA}/Jellyfin:/config
      - ${APPDATA}/Jellyfin/cache:/cache
      - ${MEDIA}:/media
      - ${DOWNLOADS}:/downloads
      - ${UPLOADMAP}:/uploads
      - ${PERSOONLIJK}:/persoonlijk
    ports:
      - 8096:8096
      - 8920:8920
      - 7359:7359/udp
      - 1900:1900/udp
    networks:
      - jellyfin_net

networks:
  jellyfin_net:
    driver: bridge

Docker logs

[cont-finish.d] executing container finish scripts...
[cont-finish.d] done.
[s6-finish] waiting for services.
[s6-finish] sending all processes the TERM signal.
[s6-finish] sending all processes the KILL signal and exiting.
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 01-envfile: executing... 
[cont-init.d] 01-envfile: exited 0.
[cont-init.d] 10-adduser: executing... 
usermod: no changes

-------------------------------------
          _         ()
         | |  ___   _    __
         | | / __| | |  /  \ 
         | | \__ \ | | | () |
         |_| |___/ |_|  \__/


Brought to you by linuxserver.io
-------------------------------------

To support the app dev(s) visit:
Jellyfin: https://opencollective.com/jellyfin

To support LSIO projects visit:
https://www.linuxserver.io/donate/
-------------------------------------
GID/UID
-------------------------------------

User uid:    1000
User gid:    100
-------------------------------------

[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 30-config: executing... 
[cont-init.d] 30-config: exited 0.
[cont-init.d] 40-gid-video: executing... 
[cont-init.d] 40-gid-video: exited 0.
[cont-init.d] 99-custom-scripts: executing... 
[custom-init] no custom files found exiting...
[cont-init.d] 99-custom-scripts: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.

Also relevant

(Based on the config file provide here)

# make sure that your dns has a cname set for jellyfin
# if jellyfin is running in bridge mode and the container is named "jellyfin", the below config should work as is
# if not, replace the line "set $upstream_app jellyfin;" with "set $upstream_app <containername>;"
# or "set $upstream_app <HOSTIP>;" for host mode, HOSTIP being the IP address of jellyfin
# in jellyfin settings, under "Advanced/Networking" change the public https port to 443, leave the local ports as is,
# and set the "Secure connection mode" to "Handled by reverse proxy"

server {
    listen 443 ssl;
    listen [::]:443 ssl;

    server_name media.*;

    include /config/nginx/ssl.conf;

    client_max_body_size 0;

    location / {
        include /config/nginx/proxy.conf;
        resolver 127.0.0.11 valid=30s;
        set $upstream_app jellyfin;
        set $upstream_port 8096;
        set $upstream_proto http;
        proxy_pass $upstream_proto://$upstream_app:$upstream_port;

        proxy_set_header Range $http_range;
        proxy_set_header If-Range $http_if_range;
    }

    location ~ (/jellyfin)?/socket/ {
        include /config/nginx/proxy.conf;
        resolver 127.0.0.11 valid=30s;
        set $upstream_app jellyfin;
        set $upstream_port 8096;
        set $upstream_proto http;
        proxy_pass $upstream_proto://$upstream_app:$upstream_port;

        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection $http_connection;
   }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions