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.

  • moira@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    2
    ·
    1 year ago

    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

    • ramOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      1 year ago

      Thanks so much! This worked perfect, thank you ♥