this post was submitted on 10 May 2024
19 points (91.3% liked)

Selfhosted

40006 readers
874 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 1 year ago
MODERATORS
 

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:

2024/05/10 08:26:37 [error] 95335#95335: send() failed (111: Connection refused) while resolving, resolver: 127.0.0.1:53
2024/05/10 08:26:37 [error] 95335#95335: send() failed (111: Connection refused) while resolving, resolver: 127.0.0.1:53
2024/05/10 08:26:42 [error] 95335#95335: send() failed (111: Connection refused) while resolving, resolver: 127.0.0.1:53
2024/05/10 08:26:47 [error] 95335#95335: send() failed (111: Connection refused) while resolving, resolver: 127.0.0.1:53
2024/05/10 08:26:52 [error] 95335#95335: send() failed (111: Connection refused) while resolving, resolver: 127.0.0.1:53
2024/05/10 08:26:57 [error] 95335#95335: send() failed (111: Connection refused) while resolving, resolver: 127.0.0.1:53
2024/05/10 08:27:02 [error] 95335#95335: send() failed (111: Connection refused) while resolving, resolver: 127.0.0.1:53
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"

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?

top 7 comments
sorted by: hot top controversial new old
[–] [email protected] 9 points 6 months ago* (last edited 6 months ago) (1 children)

Hello πŸ‘‹

You need to edit the below lines

set $jellyfin jellyfin;
resolver 127.0.0.1 valid=30s;

To look like the below

set $jellyfin 127.0.0.1;
#resolver 127.0.0.1 valid=30s;

Edited after reading the full config

[–] [email protected] 2 points 6 months ago

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!

[–] [email protected] 3 points 6 months ago (1 children)

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?

[–] [email protected] 3 points 6 months ago

Thank you, I was able to connect by editing the configuration as suggested in the other comment πŸ™‚

[–] [email protected] 2 points 5 months ago (1 children)

I'd be very careful to publicly host Jellyfin. Although not necessarily true, it basically advertises that you're pirating content while also giving out your IP. Even if you rip your own media, this can still be illegal. Please be careful.

Maybe you can put it behind some authentication or, even better, a VPN.

[–] [email protected] 2 points 5 months ago

You have a point, thx

[–] [email protected] 1 points 5 months ago* (last edited 5 months ago)

Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I've seen in this thread:

Fewer Letters More Letters
CGNAT Carrier-Grade NAT
DNS Domain Name Service/System
HTTP Hypertext Transfer Protocol, the Web
IP Internet Protocol
NAT Network Address Translation
VPN Virtual Private Network
nginx Popular HTTP server

4 acronyms in this thread; the most compressed thread commented on today has 5 acronyms.

[Thread #771 for this sub, first seen 29th May 2024, 09:05] [FAQ] [Full list] [Contact] [Source code]