Help with nginx & jellyfin

So I’m just getting started with selfhosting things, and I have a minor problem which I’m having some trouble solving, as I keep getting a connection refused error when trying to connect:

send() failed (111: Connection refused) while resolving, resolver: 127.0.0.1:53

I run a jellyfin server on a NUC - it works well and is accessible on the private network. I want to have a public URL for this server - and other stuff, eventually.

Here’s my setup

  • I have a subdomain - jellyfin.mydomain.com - pointed to the external IP for my router
  • I have the router set up to allow remote access, and port forwarding directing all port 80 traffic to my public ip > port 80 on the server
  • On my server - running ubuntu - I installed nginx
  • I used the official jellyfin nginx config for access from a subdomain
  • I edited the server_name variable to match my subdomain

Now, whenever I access the subdomain in a browser I get a 502 Bad Gateway error. The /var/lof/nginx/error.logshows:


<span style="color:#323232;">2024/05/10 08:26:37 [error] 95335#95335: send() failed (111: Connection refused) while resolving, resolver: 127.0.0.1:53
</span><span style="color:#323232;">2024/05/10 08:26:37 [error] 95335#95335: send() failed (111: Connection refused) while resolving, resolver: 127.0.0.1:53
</span><span style="color:#323232;">2024/05/10 08:26:42 [error] 95335#95335: send() failed (111: Connection refused) while resolving, resolver: 127.0.0.1:53
</span><span style="color:#323232;">2024/05/10 08:26:47 [error] 95335#95335: send() failed (111: Connection refused) while resolving, resolver: 127.0.0.1:53
</span><span style="color:#323232;">2024/05/10 08:26:52 [error] 95335#95335: send() failed (111: Connection refused) while resolving, resolver: 127.0.0.1:53
</span><span style="color:#323232;">2024/05/10 08:26:57 [error] 95335#95335: send() failed (111: Connection refused) while resolving, resolver: 127.0.0.1:53
</span><span style="color:#323232;">2024/05/10 08:27:02 [error] 95335#95335: send() failed (111: Connection refused) while resolving, resolver: 127.0.0.1:53
</span><span style="color:#323232;">2024/05/10 08:27:07 [error] 95335#95335: *69 jellyfin could not be resolved (110: Operation timed out), client: 193.29.107.173, server: jellyfin.mysubdomain.com, request: "GET /web/ HTTP/1.1", host: "jellyfin.mysubdomain.com"
</span>

I have almost no experience with networking, linux, or nginx :D So I am sure the problem is obvious to someone else…

Can you help?

fernandu00,

Does your ISP allow you to get external requests on port 80? Mine doesn’t…And I figured that the hard way trying to access my jellyfin server. Are you behind CGNAT?

EvilCartyen,

Thank you, I was able to connect by editing the configuration as suggested in the other comment 🙂

mhzawadi, (edited )
@mhzawadi@lemmy.horwood.cloud avatar

Hello 👋

You need to edit the below lines


<span style="color:#323232;">set $jellyfin jellyfin;
</span><span style="color:#323232;">resolver 127.0.0.1 valid=30s;
</span>

To look like the below


<span style="color:#323232;">set $jellyfin 127.0.0.1;
</span><span style="color:#323232;">#resolver 127.0.0.1 valid=30s;
</span>

Edited after reading the full config

EvilCartyen,

Wonderful, thank you :)

I did see that mentioned in the comments in the file, but I was under the impression that I was using DNS via my simply.com domain DNS-record. Thanks!

  • All
  • Subscribed
  • Moderated
  • Favorites
  • selfhosted@lemmy.world
  • ethstaker
  • DreamBathrooms
  • thenastyranch
  • magazineikmin
  • Durango
  • InstantRegret
  • Youngstown
  • ngwrru68w68
  • slotface
  • rosin
  • cisconetworking
  • GTA5RPClips
  • kavyap
  • mdbf
  • megavids
  • tester
  • osvaldo12
  • tacticalgear
  • khanakhh
  • everett
  • modclub
  • anitta
  • Leos
  • cubers
  • normalnudes
  • provamag3
  • JUstTest
  • lostlight
  • All magazines