this post was submitted on 14 Jun 2023
3 points (100.0% liked)

Self Hosted - Self-hosting your services.

506 readers
2 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

Important

Beginning of January 1st 2024 this rule WILL be enforced. Posts that are not tagged will be warned and if not fixed within 24h then removed!

Cross-posting

If you see a rule-breaker please DM the mods!

founded 3 years ago
MODERATORS
 

Okay, so I followed some guides starting with this one that uses CLI but then ended up roughly-following this Docker guide. I'm running Ubuntu so I had to figure some things myself.

My SSL settings are set to encryption mode full, my tunnel settings are as follows

My Owncast server is set up to 30050 and I can even connect fine through external IP, but Cloudflare's not cooperating. When I connect via my hostname, I get a 502 error, and on the server side I get the following errors:

ERR  error="Unable to reach the origin service. The service may be down or it may not be responding to traffic from cloudflared: dial tcp 127.0.0.1:30050: connect: connection refused" cfRay=7d6fe3954bcd5419-YYZ event=1 ingressRule=0 originService=http://127.0.0.1:30050/
ERR Request failed error="Unable to reach the origin service. The service may be down or it may not be responding to traffic from cloudflared: dial tcp 127.0.0.1:30050: connect: connection refused" connIndex=1 dest=https://live.ramram.ink/favicon.ico event=0 ip=198.41.192.7 type=http

I also confirmed that on the local machine, running curl 127.0.0.1:30050 works fine.

you are viewing a single comment's thread
view the rest of the comments
[–] moira@sh.itjust.works 1 points 1 year ago (1 children)

As you are running cloudflared in docker container, by default 127.0.0.1/localhost equal that docker container. Easy fix is to add

extra_hosts:
      - "host.docker.internal:host-gateway"

to your cloudflared service in docker-compose. Then you can point tunnel to host.docker.internal and it should point to your docker host instead of localhost of container. (ofc after reloading services by docker-compose up -d)

Another easy solution would be to make your owncast server listen on lan IP of your server, and point cloudflared tunnel to that

[–] ram@lemmy.ca 2 points 1 year ago

Thanks so much! This worked perfect, thank you ♥