Jellyfin behind Ngrok on docker giving issues reddit / selfhosted ---------------------------------------------------------------------- rand-int147263927852 · 2023-09-29 01:26 hello all. I have a jellyfin server that I would like to share with my friends and myself when abroad, iv'e use Ngrok for years to host MC and other game servers but never sites.(always behind CGNat or networks I have little control over.) I use a docker server with portainer running on top and my config for the stack is the following version: '3.5' services: jellyfin: image: jellyfin/jellyfin:latest container_name: jellyfin user: 1000:1000 network_mode: 'bridge' ports: - 8096:8096 - 8920:8920 volumes: - /home/fakeusername/DockerData/Jellyfin/config:/config - /home/fakeusername/DockerData/Jellyfin/cache:/cache - /mnt/Storage/Media/Movies:/Movies:ro restart: 'unless-stopped' # Optional - alternative address used for autodiscovery environment: - JELLYFIN_PublishedServerUrl="jellyfin.local" # Optional - may be necessary for docker healthcheck to pass if running in host network mode extra_hosts: - "host.docker.internal:host-gateway" ngrok-jelly: image: shkoliar/ngrok:latest ports: - 4552:4551 links: - jellyfin environment: PARAMS: "http 172.17.0.4:8096" #DOMAIN: jellyfin #PORT: "8096" #PROTOCOL: "http" REGION: "us" AUTH_TOKEN: "AABBCCDDAndSoOn" DEBUG: "true" restart: unless-stopped attempting to connect when using "jellyfin" or "localhost" as the domain results in a 502 error with the error on NGroks side being The connection to https://26ad-173-32-127-176.ngrok-free.app was successfully tunneled to your ngrok client, but the client failed to establish a connection to the local address localhost:8096. Make sure that a web service is running on localhost:8096 and that it is a valid address. The error encountered was: dial tcp 127.0.0.1:8096: connect: connection refused I've tried every combo of networking and jellyfin server remote connection "rules" I can think of and don't even know if the JF server is getting the msg and telling it to bugger off (I don't know a good way of testing that). If anyone has had experience with setting this up or might be able to help diagnose then that would be appreciated. thanks ---------------------------------------------------------------------- Ok_Isopod_3239 · 2023-09-29 11:00 I´m not an expert with ngrok (I use ngrok-network-manager) but have you looked at the [docs](https://jellyfin.org/docs/general/networking/nginx/)? ---------------------------------------------------------------------- GolemancerVekk · 2023-09-29 15:38 It doesn't look like you've connected the "jellyfin" and "ngrok-jelly" containers at a network level. By default each container only sees their own localhost (127.0.0.1) and their bridge interface (network_mode: bridge) that connects them to the host. But they can't use the bridge interfaces to "see" each other. You can achieve that in two simple modes (probably more but I'm not a docker expert either): 1. You can switch both containers from to `network_mode: host` which will tie their external interface directly into the host and let them see each other as well as everything else running on the host, participate in the host's LAN broadcasts and so on. If you do this you lose port mapping because all the ports that the apps inside the containers are using are automatically bound to the host. This option is a bit invasive and it's best to not use it unless you really need broadcasts. It's typically used by apps that need to work with DLNA or other LAN-wide casts. 2. You can remove `network_mode: bridge` and instead define a docker network specifically for these two containers. You need to (a) create the network with docker (`docker create network my-network`), (b) define the network in the yaml, (c) specify the network name in the `networks` section of *both* containers, (d) give both containers a name by which they'll find each other using the `hostname` option. After you do all this, ngrok-jelly will be able to see jellyfin using its hostname (eg. "jellyfin:8096"). [Here's a yaml](https://github.com/zuavra/nginx-ip- whitelister/blob/master/docker-compose-proxy-manager.yaml) that does all this, as example. ---------------------------------------------------------------------- rand-int147263927852 · 2023-09-29 16:05 Ok that makes sense ill try that tonight and see if i get any different results ---------------------------------------------------------------------- rand-int147263927852 · 2023-09-29 20:46 yup that was it thank you so much